Quotas export

Anonymous
2024-02-17T19:19:26+00:00

To retreive quotas and templates from listed folders I am using the script below.

$Folders = @( "D:\folde1" , "D:\folde2" , "E:\folder3" )

$QuotaList = 
foreach ($folder in $folders){
    Get-FSRMQuota -Path $Folder | Select-Object Path,@{label="Size(GB)";expression={$_.size/1GB}},Template,SoftLimit  
}

$QuotaList | Export-Csv -Path C:\Temp\test\QuotaList.csv -NoTypeInformation

I have noticed in the exported file I can't find values smaller than 1GB, the values starting from a minimum of 1GB. For example, if a quota is 600MB I should find 0.6GB. 

I have checked  also the .CSV file with notepad++ (before to import it to excel) but I couldn't find values smaller than 1GB (unless an approximation is done when powershell create the CSV file ).

 How can I fix this limit in order the script calculate also the value in MB or at least include values smaller than 1GB (e.g. 0.6GB)?

Thanks

Windows Server Remote and virtual desktops PowerShell

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Anonymous
    2024-02-19T04:29:28+00:00

    Hi,

    Is the "Size(GB)" field 0 or empty in your CSV file? What is the value of the variable $QuotaList?

    0 comments No comments
  2. Anonymous
    2024-02-19T10:05:11+00:00

    I have value in the CSV file as in $QuotaList. The script works fine

    My concern is that few folders quota should have less than 1GB instead the value I found are minimum 1GB. I was thinking the scrips is collecting only the folder that have at least 1GB or potentially change the MB value to 1GB. Not sure.

    0 comments No comments
  3. Anonymous
    2024-02-20T07:14:35+00:00

    That's a little weird. There are no paths filtered out in the script. Can you help to check the output of the command on some folder with a quota less than 1GB?

    $Folder = "C:\quota\less\than\1GB"
    
    Get-FSRMQuota -Path $Folder | Select-Object Path,@{label="Size(GB)";expression={$_.size/1GB}},Template,SoftLimit
    
    0 comments No comments