Microsoft® Windows® 2000 Scripting Guide
« Previous | Next »
You can enable and disable disk quotas on a volume by toggling the value of the DiskQuotaControl QuotaState property. When the value of the QuotaState property is set to 2, quotas are enabled and enforced; users who exceed their quota limit will not be able to save additional data to the drive. When the value of the QuotaState property is set to 1, quotas will be enabled but not enforced. This means that users who exceed their quota limit will still be able to save data to the drive. When the value of the QuotaState property is set to 0, quotas are disabled.
When you disable quotas on a volume, you do not discard previous quota information. Instead, you simply stop the Windows 2000 operating system from enforcing disk quotas and tracking disk space usage.
For example, suppose you have a volume with the quota entries shown in Table 10.5.
Table 10.5 Sample Disk Quota Entries
Name | Quota Limit | Warning Level |
---|---|---|
KMeyer | 100 MB | 90 MB |
PAckerman | 200 MB | 180 MB |
RWilliams | 400 MB | 350 MB |
If you disable disk quotas on this volume, these quota entries are not deleted. If you later decide to re-enable disk quotas, each of the entries shown in Table 10.5 is restored, along with the appropriate quota limit and warning level.
Listing 10.10 contains a script that enables disk quotas for drive C on a computer. To carry out this task, the script must perform the following steps:
The Initialize method requires the following two parameters:
Listing 10.10 Enabling Disk Quotas
|
|
Send us your feedback | « Previous | Next » |