The Set-Quota PowerShell script (attached below) applies or removes disk quotas for protected client computers. It uses the expected data size per client value of the protection group to set the required disk quota for the client computers protected under that protection group.
The script leverages windows FSRM (File Server Resource Manager) which should be installed on the DPM server before scripts can run.
Using the script, the quota can be applied or removed for:
1) All client Protection groups in the DPM Server.
2) A specific protection group.
3) A specific client machine.
Things to note when using the script:
Script disables auto grow
: Auto grow is a check box setting available in the PG creation flow which enables the client’s replica to grow automatically when data size exceeds allocated replica size. This particular setting will be unchecked if quota script is run for the PG or a client in the PG. It is to make sure that when client’s data grows out of its quota limit, the backups start to fail with Replica volume threshold exceeded.
Script should be run when clients are added for protection:
The script when executed, applies quota for all the clients for whom protection is configured as of now in DPM. When new clients keep getting added to protection, script should be run to again set quota for them. You can also schedule quota script to run at desired frequency.
Ability to set threshold
: Script provides ability to set a warning threshold for early indication of anticipatory failures. It is notified with a
in Application events with id:
whenever a client’s backup data size crosses the threshold limit.
Quota exceeded Indication
: When client’s data exceeds the quota limit, an
is also raised in application event viewer with id: 12325. DPM’s backups also fail with ‘
Replica Disk threshold exceeded
’ alert in DPM. Client UI also shows the backup related
: The script logs its activity in log file: [DPM Install Path]\DPM\Temp\Set-Quota.log.
: From DPM PowerShell command, run
. The help works like any other command let. See some
Details for deployment/testing:
1) Copy Set-Quota.ps1, QuotaExceededNotification.txt, QuotaThresholdNotification.txt and Set-Quota-Scheduler.bat from the zip folder to DPM bin folder.
2) To run script manually, open DPM management shell and run Set-Quota.ps1. (get-help Set-Quota.ps1 for help)
3) To schedule the script, create a new scheduled task with Set-Quota-Scheduler.bat as the target.
Expected data size setting per Client:
Enabling FSRM in DPM Server:
From Server manager wizard, do the following 2 steps
' Role if not already added:
2. Go to File Services Role and in
'Add Role Services'
'File Server Resource Manager'
and chose install as shown below:
Disk Quota Threshold Exceeded Warning Event:
Disk quota exceeded error event:
Quota exceeded failure in DPM:
Backup Error in Client:
To see the examples, type: "get-help C:\Program Files\Microsoft DPM\DPM\bin\Set-Quota.ps1 -examples".
For more information, type: "get-help C:\Program Files\Microsoft DPM\DPM\bin\Set-Quota.ps1 -detailed".
For technical information, type: "get-help C:\Program Files\Microsoft DPM\DPM\bin\Set-Quota.ps1 -full".