I want to delete user quotas from the disk quota manager and I am affraid that this is not possible to do via API other then the disk quota management GUI in Windows Server 2003.
Is there any way that I can delete user disk quotas via API?!?! :bawling:
I don't know about using an API, but you can probably access the information and change it (delete it or whatever) using WMI.
regards,
J.
I know how to Add, change, and read quotas with WMI... but i can't figure out the deleting part. There seems to be no Method in the class that will delete a quota. Even on the MSDN when you go to look up info on quota management they tell you different ways do do a taks, e.g. GUI / API / or cmd-line.... on the MSDN there seems to be no information on deleting user quotas via WMI except though the GUI interface.
There must be a way, I dont see an administrator sitting down to delete thousands of un-needed quotas by hand....
TDMWeb
12-05-2003, 12:40 PM
The IDiskQuotaUser interface has a method DeleteUser.
The user must not own any files on the volume you wish to delete the quota for (ie delete all his files/dirs first). The quota entry is marked for deletion when you use this method: the system will actually delete it later, when it feels like it. If you enumerate quota entries before the system deletes it, this user won't show up even though it's still there.
See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/idiskquotauser.asp
and
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/idiskquotacontrol_deleteuser.asp
and
http://www.thedelphimagazine.com/samples/1488/1488.htm
(we publish The Delphi Magazine).
Damn MSDN, sorry I overlooked this. I kept looking under WMI stuff to do this. That helps me out alot, Thanks TDMWeb ;)