3.17. Viewing Disk Quota Usage
You want to view the quota usage for one or more users.
Using a graphical user interface
Open Windows Explorer.
Browse to the drive on which you want to enable quotas, right-click it, and select Properties.
Click the Quota tab.
If quotas are enabled, click the Quota Entries button. If quotas are not enabled, enable them as described in Recipe 3.15.
The Quota Entries application contains a listing of all users that have quotas configured along with their quota limit, warning limit, and amount used. You can sort this screen by selecting View → Arrange Items from the menu and choosing one of the options to sort by.
Using a command-line interface
Use the following command to view the quota usage for all users on drive D:
> fsutil quota query d:
Use the following command to search the event log for all users that are violating their quota:
> fsutil quota violations
Before using the
violations options of fsutil, be sure that you've enabled
event logging of warning and limit errors (see Recipe
' This code displays the quota usage for users on a particular drive. ' ------ SCRIPT CONFIGURATION ------ strComputer = "." strDrive = "
<Drive>" ' e.g., D: ' ------ END CONFIGURATION --------- set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") set colQuotas = objWMI.ExecQuery("select * from Win32_DiskQuota " & _ "where QuotaVolume = 'Win32_LogicalDisk.DeviceID=""" & strDrive & """'") for each objQuota in colQuotas WScript.Echo ...