Dirquota quota add

Applies To: Windows Server 2008

Creates and configures a new quota.

Note

To use this command, you must be logged on as an administrator or a member of the Administrators group.

For examples of how to use this command, see Examples.

Syntax

dirquota quota add /path:<Path> {[/sourcetemplate:<TemplateName>] | [/limit:<Limit>[kb | mb | gb]]} 
   [/type:{hard | soft}] [/status:{enabled | disabled}] [/add-threshold:<Level>] [...] 
   [/add-notification:<Level>,<NotifyType>,<ConfigFile>] [...] 
   [/overwrite | /ignore] [/remote:<ComputerName>]

Parameters

Parameter Description

/path:<Path>

Creates a quota on path Path. You can append the following wildcard characters:

  • \. — the folder specified by Path

  • \* — all immediate subfolders of Path

/sourcetemplate:<TemplateName>

Derives quota properties from the quota template TemplateName. If the template name contains a space, enclose the name in quotation marks.

/limit:<Limit>[kb | mb | gb]

Specifies the space limit for the volume or folder. By default, Limit is in denoted in kilobytes (KB), but you can append kb, mb, or gb to the number to specify the unit.

/type:{hard | soft}

Specifies quota type:

  • hard — prevents users from saving files when the limit is reached

  • soft — allows the limit to be exceeded

If the quota type is not derived from/sourcetemplate:TemplateName or is not specified, a hard limit is configured by default.

/status:{enabled | disabled}

Configures a quota with a status of enabled (meaning that the quota is enforced) or disabled.

If you do not use this parameter, the quota is enabled by default.

/add-threshold:<Level> [...]

Adds a notification threshold at percentage Level. You can use the parameter multiple times.

/add-notification:<Level>,<NotifyType>,<ConfigFile> [...]

Adds a notification to the notification threshold at Level, of type NotifyType, configured according to the information in the configuration file ConfigFile. You can use this parameter multiple times.

Level must be the percentage level of an existing notification threshold.

NotifyType must be one of the following:

  • m — an e-mail notification

  • e — an event log notification

  • c — a command or script execution

  • r — a report generation

ConfigFile is the path to the configuration file for the notification. For more information, see Configuration files for notifications in File Server Resource Manager.

Important
If the value specified for NotifyType does not match the value of the Notification parameter in the configuration file, the command will fail with an error.

/overwrite | /ignore

Overwrites a quota that already exists on the path, or ignores the existing quota (that is, leaves the quota unchanged).

/remote:<ComputerName>

Performs the operation on the remote computer ComputerName.

Remarks

  • The **/sourcetemplate:**TemplateName parameter derives the following properties from the quota template TemplateName:

    • Space limit

    • Quota type (hard or soft)

    • Notification thresholds and notifications (if configured)

    You can override the space limit and quota type values of the quota template by using the /limit: and /type: parameters.

    You can use the /add-notification: parameter to add a notification at any notification threshold derived from TemplateName.

  • To create and manage quota templates, use the Dirquota template command.

  • The shortest sequence of characters that uniquely identifies a parameter can be used as an abbreviation. For example, the following two commands are equivalent:

    dirquota q a /p:d:\scratch /so:"100 mb limit" 
    dirquota quota add /path:d:\scratch /sourcetemplate:"100 mb limit"
    
  • To perform operations on a remote computer by using the **/remote:**ComputerName parameter:

    • You must be logged on with a domain account that is a member of the Administrators group on both the local computer and the remote computer.

    • The remote computer must be running Windows Server 2008, and File Server Resource Manager must be installed.

    • The Remote File Server Resource Manager Management exception on the remote computer must be enabled. You enable this exception by using Windows Firewall in Control Panel.

Examples

  • To create a 50-MB hard quota in the D:\scratch folder, type:

    dirquota quota add /path:d:\scratch /limit:50mb
    
  • To create a quota that is based on the User Quota template, with a custom e-mail notification at the 80-percent usage level (configured with the file quotaexceeded.txt), in a specific user's folder, type:

    dirquota quota add /path:d:\users\user1 /sourcetemplate:"user quota" /add-threshold:80 /add-notification:80,m,quotaexceeded.txt
    

Additional references

Command-Line Syntax Key

Dirquota notification

Dirquota quota