Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Users\Administrator> Get-SmbShare
Name ScopeName Path Description
---- --------- ---- -----------
ADMIN$ * C:\Windows Remote Admin
C$ * C:\ Default share
D$ * D:\ Default share
IPC$ * Remote IPC
Share01 * D:\Share01
ShareAll * D:\ShareAll
# display templates of Quota
PS C:\Users\Administrator> Get-FsrmQuotaTemplate
Description :
Name : 100 MB Limit
Size : 104857600
SoftLimit : False
Threshold : {MSFT_FSRMQuotaThreshold, MSFT_FSRMQuotaThreshold, MSFT_FSRMQuotaThreshold}
UpdateDerived : False
UpdateDerivedMatching : False
PSComputerName :
.....
.....
Description :
Name : 2 GB Limit
Size : 2147483648
SoftLimit : False
Threshold : {MSFT_FSRMQuotaThreshold, MSFT_FSRMQuotaThreshold, MSFT_FSRMQuotaThreshold}
UpdateDerived : False
UpdateDerivedMatching : False
PSComputerName :
.....
.....
# for example, apply 2GB hard limit template to [Share01] folder
PS C:\Users\Administrator> New-FsrmQuota -Path "D:\Share01" -Description "limit usage to 2 GB based on template" -Template "2 GB Limit"
Description : limit usage to 2 GB based on template
Disabled : False
MatchesTemplate : True
Path : D:\Share01
PeakUsage : 3072
Size : 2147483648
SoftLimit : False
Template : 2 GB Limit
Threshold : {MSFT_FSRMQuotaThreshold, MSFT_FSRMQuotaThreshold, MSFT_FSRMQuotaThreshold}
Usage : 3072
PSComputerName :
# if disable applied Quota temporally, set like follows
PS C:\Users\Administrator> Set-FsrmQuota -Path "D:\Share01" -Disabled:$true
# if enable disabled Quota, set like follows
PS C:\Users\Administrator> Set-FsrmQuota -Path "D:\Share01" -Disabled:$false
# to remove added Quota entry, set like follows
PS C:\Users\Administrator> Remove-FsrmQuota -Path "D:\Share01"
Confirm
Are you sure you want to perform this action?
Operation: Delete, Object: quota, Object Identifier (Path): D:\Share01
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
|