DiskQuotaControl object
Allows an administrator to manage a volume's disk quota properties. The NTFS file system allows an administrator to manage disk usage on a shared volume by allocating a specified amount of disk space, or quota limit, to each user. You can use this object to set the default quota limit that will be automatically assigned to all new users.
Members
The DiskQuotaControl object has these types of members:
Events
The DiskQuotaControl object has these events.
Event | Description |
---|---|
OnUserNameChanged | Occurs when the name information for a DIDiskQuotaUser object has been resolved. |
Methods
The DiskQuotaControl object has these methods.
Method | Description |
---|---|
AddUser | Assigns a nondefault disk quota to a new user. |
DeleteUser | Deletes a user from the volume. |
FindUser | Finds a user's entry, by name, in the volume's quota file. |
GiveUserNameResolutionPriority | Places the specified user object next in line for name resolution. |
Initialize | Opens a specified volume and initializes its quota control object. |
InvalidateSidNameCache | Invalidates the security ID user name cache. |
ShutdownNameResolution | Shuts down the user name resolution thread. |
TranslateLogonNameToSID | Translates a logon name to the corresponding user security ID in string format. |
Properties
The DiskQuotaControl object has these properties.
Property | Access type | Description |
---|---|---|
DefaultQuotaLimit |
Read/write |
Sets or gets the default quota limit. |
DefaultQuotaLimitText |
Read-only |
Gets the default quota limit as a text string. |
DefaultQuotaThreshold |
Read/write |
Sets or gets the default quota threshold. |
DefaultQuotaThresholdText |
Read-only |
Gets the default quota threshold as a text string. |
LogQuotaLimit |
Read/write |
Sets or gets a Boolean value that indicates whether a system event log entry will be made when a user exceeds his or her assigned quota limit. |
LogQuotaThreshold |
Read/write |
Sets or gets a Boolean value that indicates whether a system event log entry will be made when a user exceeds his or her assigned quota threshold. |
QuotaFileIncomplete |
Read-only |
Gets a Boolean value that indicates whether the quota file for the volume is complete. |
QuotaFileRebuilding |
Read-only |
Gets a Boolean value that indicates whether the quota file for the volume is currently being rebuilt. |
QuotaState |
Read/write |
Sets or gets the state of the volume's disk quotas. |
UserNameResolution |
Read/write |
Sets or gets a value that controls how user SID are resolved to user names. |
Remarks
An administrator can use the DiskQuotaControl object to do a number of tasks, including the following:
- Enabling and disabling the volume's disk quota system.
- Obtaining the status of the quota system on the volume.
- Denying disk space to users exceeding their quota limit.
- Specifying the default warning threshold and quota limit values that will be assigned to new users.
- Adding and removing users.
The DiskQuotaControl object allows you to set global default values for the volume for properties such as quota limits. However, each user is represented by a DIDiskQuotaUser object that can be used to specify individual quota settings.
There are several ways to obtain a user's DIDiskQuotaUser object:
- The DIDiskQuotaUser objects for all users with quotas on the volume are exposed as a collection, and can be enumerated. For a discussion of how to enumerate DIDiskQuotaUser objects, see Enumerating Disk Quota Users in the Remarks section of DIDiskQuotaUser.
- When you add a new user, the AddUser method returns the user's DIDiskQuotaUser object.
- If you have the user's name, the FindUser method returns the user's DIDiskQuotaUser object.
This object makes the essential functionality of the IDiskQuotaControl interface available to scripting and Microsoft Visual Basic-based applications.
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
Minimum supported server |
Windows 2000 Server [desktop apps only] |
DLL |
|
See also