File Server Resource Manager Quota Adjustment – Quick and Dirty

DR tests are fun.  Manually flipping file servers w/ Robocopy as the synchronization mechanism is not.  Hurry up, Server 2016, you’re my only hope.

We ended up having to make some quota adjustments on the fly to handle data changes after a DR test, and here’s the quick and dirty script I wrote to adjust them.

I *highly* recommend testing in your environment and also changing it to log changes to a custom PSObject for easy exporting to CSV and easy reporting.  But for me, this afternoon, it worked.

$Quotas = Get-FSRMQuota

$QuotasToMod = @()

foreach($Quota in $Quotas)
{
if($($Quota.Usage) -gt $($Quota.Size * .90))
{
Write-Host "$($Quota.Path)`tCurrent Size:$($Quota.Usage)`tCurrent Limit:$($Quota.Size)"
$QuotasToMod +=$Quota
}
}

Write-Host "Mod count:`t $($QuotasToMod.Count)"

foreach($ToMod in $QuotasToMod)
{
Get-FsrmQuota -Path $($ToMod.Path) | Set-FsrmQuota -Size ($($ToMod.Usage) * 1.2) -SoftLimit:$false
}
Advertisements
This entry was posted in Disaster Recovery, File Services, Powershell, Scripting, Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s