So my customer is migrating from Windows 2012 to Windows 2012R2 and needed to migrate  user quotas between Windows 2012 and the new Windows 2012R2 server.

So one way would be to copy the quota.xml and quota.md files but I’m not sure that Microsoft would condone or support a suggestion like that so I will go the cmdlets from Windows 2012R2.

Lets roll, Lets get all the old quotas:

$oldserver = New-CimSession -ComputerName file01
$oldquotas = Get-FsrmQuota -CimSession $oldserver

Now we have all quotas of the old server. Lets just filter out the ones we want and apply them on the new location.

$oldquotas|Where-Object{$_.Path -like 'F:\quotaSub1*'} | ForEach {New-FsrmQuota -Path:($_.Path -replace 'F:','E:') -Size:$_.Size -Template:$_.Template -Softlimit:$_.Softlimit }

We still need to migrate the auto quotas. But that is simple too:

$oldautoquotas = Get-FsrmAutoQuota -CimSession $oldserver
$oldautoquotas|Where-Object{$_.Path -like 'F:\quotaSub1'} | ForEach {New-FsrmAutoQuota -Path:($_.Path -replace 'F:','E:') -Template:$_.Template}