Programmatically manage R2 quotas using cmd-line tools

Most folks are aware that Windows Server 2003 R2 offers directory-based quotas, a great new feature that is better for some hosters than the volume/user based quotas in Windows 2003 Server RTM and SP1. 

To get quota going in R2, generally you can just add a quota template that gives 150MB to each directory. This is a global template that applies to all folders on your E: drive, for example. But let's say you'd like to customize quotas for each customer's directory, if they pay for more disk space for example. Many times you would like to be able to do this programmatically from another machine.

To achieve this goal, you can use the command-line tools available (dirquota, filescrn or storrept) and run them remotely.

Here is an overview of the three tools. You can see that they have a /Remote:<Server> parameter allowing you to run them against a remote server from the command prompt.
http://blogs.dirteam.com/blogs/r2/archive/2005/11/19/104.aspx

But there are also ways to call the executables remotely. Here are a few resources for running executables remotely, with WMI or ASP.NET.
http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov04/hey1115.mspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDiagnosticsProcessClassTopic.asp

Share this post: Email it! | bookmark it! | digg it! | reddit!

No Comments