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 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 3.15). |
|
Using VBScript
' 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 "User: "& objQuota.User WScript.Echo " Volume: "& objQuota.QuotaVolume WScript.Echo " Quota Limit: " & _ objQuota.Limit / 1024 / 1024 & "MB" WScript.Echo " Warning Limit: " & _ objQuota.WarningLimit / 1024 / 1024 & "MB" WScript.Echo " Disk Space Used: " & _ objQuota.DiskSpaceUsed / 1024 / 1024 & "MB" WScript.Echo "" next
Discussion
One of the nice features of the Quota Entries application is that you can drag and drop entries in it to a spreadsheet application like Excel. Simply highlight the entries you're interested in and drag them to Excel. You can also copy and paste them using Ctrl-C and Ctrl-V.
If you've enabled compression on a volume where quotas are also enabled, you may actually see quota usage increase compared to the same volume without compression. See MS KB 320686 for more information on this issue.
See Also
Recipe 3.16, MS KB 307984 (HOW TO: Create Disk Quota Reports in Windows XP), MS KB 308664 (How To Export and Import Disk Quota Settings to Other Volumes in Windows XP), and MS KB 320686 (Disk Quota Charges Increase If You Turn On the NTFS Compression Functionality)