Enumerates disk quota information (including user name, warning and quota limits, and disk space used) for each disk quota entry on a computer.

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

import win32com.client
strComputer = "."
objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator")
objSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2")
colItems = objSWbemServices.ExecQuery("Select * from Win32_DiskQuota")
for objItem in colItems:
    print "Disk Space Used: ", objItem.DiskSpaceUsed
    print "Limit: ", objItem.Limit
    print "Quota Volume: ", objItem.QuotaVolume
    print "Status: ", objItem.Status
    print "User: ", objItem.User
    print "Warning Limit: ", objItem.WarningLimit