Hi Team,
We have a powershell script that we use to monitor quota on windows shares.
However, the script returns a Warning when no data is in the folder.
WARNING: 0.00 GB of 600.00 GB used, 0.00% used.
Can someone please help fix this?
Here is the command definition and have attached the script as well.
check_quota_Copies=check_quota.ps1 -Path "M:\Shares\Copies" -Warn 20 -Crit 10
Thank you,
Rebecca Murray
Shared drives quota
-
RebeccaIlene
- Posts: 164
- Joined: Tue Apr 02, 2019 8:38 pm
Shared drives quota
You do not have the required permissions to view the files attached to this post.
Re: Shared drives quota
You should be able to do this (adding .00 to both warn and crit):
check_quota.ps1 -Path "M:\Shares\Copies" -Warn 20.00 -Crit 10.00
Or change these lines:
To these:
check_quota.ps1 -Path "M:\Shares\Copies" -Warn 20.00 -Crit 10.00
Or change these lines:
Code: Select all
$percentUsed = "{0:n2}" -f ($quotaObject.Usage / $quotaObject.Size * 100)
$percentFree = "{0:n2}" -f (100 - $quotaObject.Usage / $quotaObject.Size * 100)Code: Select all
$percentUsed = [int]($quotaObject.Usage / $quotaObject.Size * 100)
$percentFree = [int](100 - $quotaObject.Usage / $quotaObject.Size * 100)