3.16. Configuring a Disk Quota for a User

Problem

You want to configure disk quota limits for a particular user.

Solution

Using a graphical user interface

  1. Open Windows Explorer.

  2. Browse to the drive on which you want to enable quotas, right-click it, and select Properties.

  3. Click the Quota tab.

  4. If quotas are enabled, click the Quota Entries button. If quotas are not enabled, enable them as described in Recipe 3.15.

  5. To configure a new quota entry for a user, select Quota New Quota Entry from the menu.

  6. Use the object picker to locate the target user and click OK. The Add New Quota Entry dialog will open.

  7. If you've configured a default quota, that limit will be selected by default. You can disable disk quota enforcement for this user or set new limit and warning levels. After you are done, click OK.

Using a command-line interface

The following command configures a quota for a particular user:

> fsutil quota modify <Drive> 
                  <WarningBytes> 
                  <LimitBytes> 
                  <Domain\User>

The following example sets a quota for user AMER\rallen with a ~381 MB warning and ~476 MB limit:

> fsutil quota modify d: 400000000 500000000 AMER\rallen

Using VBScript

' This code configures a quota for a particular user.
' ------ SCRIPT CONFIGURATION ------
strComputer = "."
strUser = "<User>"             ' e.g., rallen
strUserDomain = "<Domain>"     ' e.g., AMER
strDrive = "<Drive>" ' e.g., D: intLimit = 1024 * 1024 * 600 ' = 600 MB intWarning = 1024 * 1024 * 350 ' = 350 MB ' ------ END CONFIGURATION --------- set objWMI = GetObject("winmgmts:\\" ...

Get Windows Server Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.