Enumerates the disk quota settings for each drive on a computer.

This script was tested using Python 2.2.2-224 for Microsoft Windows, available from ActiveState.

Python
Edit|Remove
import win32com.client
strComputer = "."
objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator")
objSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2")
colItems = objSWbemServices.ExecQuery("Select * from Win32_QuotaSetting")
for objItem in colItems:
    print "Caption: ", objItem.Caption
    print "Default Limit: ", objItem.DefaultLimit
    print "Default Warning Limit: ", objItem.DefaultWarningLimit
    print "Description: ", objItem.Description
    print "Exceeded Notification: ", objItem.ExceededNotification
    print "Setting ID: ", objItem.SettingID
    print "State: ", objItem.State
    print "Volume Path: ", objItem.VolumePath
    print "Warning Exceeded Notification: ", objItem.WarningExceededNotification