Windows 2019
Sponsored Link

File Server : Set auto apply Quotas2019/09/23

 
Set auto applied Quota settings to Volumes or Folders on File Server.
If configured auto apply Quota to a folder, Quota template is set to subfolders (existing and new one both) in the folder automatically. (but not applied to subfolders in subfolders, it's not recursively)
[1] Run PowerShell with Admin Privilege and Configure.
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
Share02  *         D:\Share02
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, set auto apply quota template with 2GB hard limit to [Share02] folder
PS C:\Users\Administrator> New-FsrmAutoQuota -Path "D:\Share02" -Template "2 GB Limit" 

Disabled              : False
Path                  : D:\Share02
Size                  : 2147483648
SoftLimit             : False
Template              : 2 GB Limit
Threshold             : {MSFT_FSRMQuotaThreshold, MSFT_FSRMQuotaThreshold, MSFT_FSRMQuotaThreshold}
UpdateDerived         : False
UpdateDerivedMatching : False
PSComputerName        :

# if disable auto apply Quota temporally, set like follows
PS C:\Users\Administrator> Set-FsrmAutoQuota -Path "D:\Share02" -Disabled:$true 

# if enable disabled auto apply Quota, set like follows
PS C:\Users\Administrator> Set-FsrmAutoQuota -Path "D:\Share02" -Disabled:$false 

# to remove added auto apply Quota entry, set like follows
PS C:\Users\Administrator> Remove-FsrmAutoQuota -Path "D:\Share02" 

Confirm
Are you sure you want to perform this action?
Operation: Delete, Object: auto-quota, Object Identifier (Path): D:\Share02
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y
File Server : Set auto apply Quotas (GUI)
 
On GUI configuration, set like follows.
[2] Run [Start] - [Server Manager] - [Tools] - [File Server Resource Manager].
[3] Select [Quotas] on the left pane and right-click it, then Open [Create Quota].
[4] Input the Share Path you'd like to set auto apply Quota in [Quota path] field.
And Check a box [Auto apply template and create quotas on existing and new subfolders].
For Quota properties, Select a templates you'd like to set.
[5] Confirm selections and if that's OK, Click [Create] button.
[6] Auto apply Quota entry has just been added.
[7] For auto apply Quota setting, each subfolder under the folder you set auto apply Quota are shown on the Quota entries like follows.
Matched Content