Changing Site Collection Quota for Personal Sites

During migration of personal Sites from SharePoint 2010 to SharePoint 2013 I saw an issue where most of Personal Sites quota is not assigned properly.  The reason could be the my site databases are not upgraded successfully.  I tried some basic PowerShell script to change the personal site quota but got the following error.

image

I even tried with Server OM with PowerShell but result was same.  So for now I will say just fix the database upgrade issue.

Get List of Personal Sites and Quota

Start-SPAssignment -Global
$PersonalSites = @();
$MySites = get-spwebapplication https://mysites.contoso.com/
foreach($Site in $MySites.Sites)
{
    if($Site.Url.Contains("personal")) #Ignore MySite Host
    {
        $Site = New-Object PSObject
        Add-Member -input $Site noteproperty 'Url' $Site.Url
        Add-Member -input $Site noteproperty 'Quota' $Site.Quota
        $PersonalSites += $Site
    }
}
Stop-SPAssignment -Global
$PersonalSites | Out-File C:\MySiteQuota.txt 

Change the Quota for Personal Sites

Start-SPAssignment -Global
$TemplateName = "Personal Site"
$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$quotaTemplate = $contentService.QuotaTemplates[$TemplateName] 

$MySites = Get-SPWebApplication https://mysites.contoso.com/ | Get-SPSite -Limit ALL | 
  Where-Object {$_.ServerRelativeUrl.Contains("/personal/")} |
  ForEach-Object { $_.Quota = $quotaTemplate }
Stop-SPAssignment -Global
Advertisements

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