3.15. Enabling Disk Quotas

Problem

You want to use disk quotas on an NTFS-formatted filesystem.

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. Check the box beside Enable quota management. This turns on disk quota tracking.

  5. Check the box beside Deny disk space to users exceeding quota limit to turn on disk quota enforcement.

  6. Configure the default quota limit if you want to have one.

  7. Under the quota logging options, check the appropriate boxes if you want to have messages logged to the event log every time a user exceeds his quota warning or limit levels.

  8. Click OK.

  9. A dialog box will pop open that informs you the disk needs to be scanned to collect disk statistics. Click OK.

Using a command-line interface

The following command enables disk quota enforcement on drive D:

> fsutil quota enforce d:

The following command enables disk quota tracking on drive D:

> fsutil quota track d:

The following command disables disk quotas on drive D:

> fsutil quota disable d:

Tip

You cannot modify the default limit and warning settings with fsutil.

Using VBScript

' This code enables disk quotas on a drive.
' This code works on 2003 and XP, but not 2000 systems.
' ------ SCRIPT CONFIGURATION ------
strComputer = "."
strDrive = "<Drive>" ' e.g., D: intEnable = 2 ' 0 = Disabled, 1 = Tracked, 2 = Enforced intDefaultLimit = 1024 * 1024 * 500 ' 500 MB intDefaultWarning = 1024 * 1024 * 400 ' ...

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.