Programming FSRM quotas

Introduction

Recently I was evaluating the options I had for implementing disk quotas on a backend system running on a major Internet Service Provider in Brazil.

Windows offers quota management up to some degree since NTFS 5 (Windows 2000) with user/volume quotas. Those were not appropriate for our scenario since we needed to set quotas on a per directory basis and this was not supported natively by Windows until the arrival of Windows Server 2003 R2.

R2 brings us a new feature called File Server Resource Manager a.k.a. FSRM. It is exposed for the system administrator as an MMC 3.0 snap-in.

Unfortunately, as of today Microsoft does not officially support any way for programming against FSRM quotas. I said “officially support” because if the snap-in can do it, probably we can too! So after some research I found two DLLs called srm.dll and srmlib.dll that happens to do the stuff we want. Srm.dll exposes FSRM functionality through COM and srmlib.dll is a managed code wrapper around srm.dll.

Related

4 thoughts on “Programming FSRM quotas”

Nice post thanks! Now, is there a way to remotely manage quotas using your code? My goal is to build a web page for users to manage quotas on any file server we have. Is that possible using the API? Someway of declaring against wich server to run the code.

Hi, I’m trying (as Tolga did) to remotely manage quotas on a fileserver from a .net application running on a separate server… do you know if it’s possible using the managed code assembly you used? thanks in advance for your help, Filippo