Sunday, January 21, 2018

Manage site collection storage limits

Manage site collection storage limits

SharePoint Online in Office 365 is allocated a quantity of storage that's based on your number of users (see SharePoint Online Limits). The storage is available to all site collections in the tenant and serves as a central pool from which everyone can draw. You, the global admin, don't need to divvy up storage space or reallocate space based on usage. That's all handled automatically: site collections use what they need when they need it, up to a maximum of 25 terabyte (TB) per site collection. If you find that your storage pool is running low, you can always buy more storage through the SharePoint Online admin center at a cost per gigabyte (GB) per month.

The pooled storage model is new to SharePoint Online. You can take advantage of this by setting the storage management option to "auto." When you do, SharePoint Online disregards any existing limits you previously set on your site collections and reset them all to 1 TB. New Office 365 customers will get pooled storage by default.

Manage storage limits automatically

  1. Sign in to Office 365 as a global admin or SharePoint admin.

  2. Select the app launcher icon The icon that looks like a waffle and represents a button click that will reveal multiple application tiles for selection. in the upper-left and choose Admin to open the Office 365 admin center. (If you don't see the Admin tile, you don't have Office 365 administrator permissions in your organization.)

  3. In the left pane, choose Admin centers > SharePoint.

  4. Select settings.

  5. In Site Collection Storage Management, select Automatic.

    Office 365 SharePoint Online Settings Screen with Site Collection Managment highlighted
  6. Click OK.

If you prefer to fine tune the storage space allocated to each site collection, you can set your storage management option to "manual" and specify individual site collection storage limits. In this case, we recommend that you also set an email alert so that you and other site collection admins can be notified when site collections are nearing the storage limit.

Important: SharePoint Online now calculates storage in gigabytes (GB) instead of megabytes (MB) and only full integers are allowed. This does not affect your total storage in SharePoint Online.

Manage storage limits manually

  1. Sign in to Office 365 as a global admin or SharePoint admin.

  2. Select the app launcher icon The icon that looks like a waffle and represents a button click that will reveal multiple application tiles for selection. in the upper-left and choose Admin to open the Office 365 admin center. (If you don't see the Admin tile, you don't have Office 365 administrator permissions in your organization.)

  3. In the left pane, choose Admin centers > SharePoint.

  4. Select settings.

  5. In Site Collection Storage Management, select Manual.

  6. Click OK.

Set the storage limit

  1. Sign in to Office 365 as a global admin or SharePoint admin.

  2. Select the app launcher icon The icon that looks like a waffle and represents a button click that will reveal multiple application tiles for selection. in the upper-left and choose Admin to open the Office 365 admin center. (If you don't see the Admin tile, you don't have Office 365 administrator permissions in your organization.)

  3. In the left pane, choose Admin centers > SharePoint.

  4. On the Site Collections tab choose one or more site collections from the list.

  5. Select Storage Quota. If the storage quota button is not enabled, select the site collection you want to set a quota on from the list below.

    Site Collections tab with Storage Quota button highlighted
  6. In Limit storage quota for each site collection, enter the maximum number of gigabytes (GB) to be allocated to the site collection.

  7. Check the box to send email to the site collection administrators when the site collections approaches the storage limit. Enter a number from 1 to 100 for the percentage of the limit to reach before an email alert is triggered.

    Set storage quota dialog box

    Tip: You may need to update the email alert percentage based on the new converted storage metrics.

  8. Click Save.

When site collection administrators set storage limits to "manual", they need to regularly monitor it to make sure performance and production aren't affected. After manually setting a site collection storage limit we recommend that administrators also set alert email to notify them before a site collection reaches the limit. The storage quota warning email is typically sent weekly but is only sent after a site collection reaches the specified warning level. So site administrators often receive the storage quota warning email later than is needed, For example, if the Disk Quota Warning timer job—that triggers the warning email—is scheduled weekly and sends the email warning every Sunday, but a site collection reaches the quota warning limit on Monday, the administrator doesn't receive the alert email for 6 days. There is a chance that this site collection can reach the maximum storage limit before the admin receives the alert email. This could cause the site collection to be set to read-only and stop production.

After site collection storage limits are set to manual, administrators need to monitor the following:

  • regular storage usage of site collections

  • analyze the usage trends and patterns

  • reallocate available storage space to site collections that need more space

  • reconfigure warning levels

We've provided aPowerShell script that administrators can use to monitor their site collections. This Windows PowerShell script pulls the data, composes, and then sends the storage warning alerts to the administrator.

  1. Install the SharePoint Online Management Shell.

    For permissions and the most current information about Windows PowerShell for SharePoint Products, see the online documentation at Windows PowerShell for SharePoint Server 2016 reference.

  2. Copy the following text with the variable declarations, and paste it into a text editor, such as Notepad. You must set all of the input values to be specific to your organization. Save the file, and name it "GetEmailWarning.ps1".

    Note: You can use a different file name, but you must save the file as an ANSI-encoded text file with the extension .ps1.

    #Connect to tenant admin center using GA credentials 
    $username = "<GA Account or Tenanat Admin>"
    $password = ConvertTo-SecureString "<Password>" -AsPlainText -Force
    $cred = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
    Connect-SPOService -Url <SharePoint Admin Center Url> -Credential $cred

    #Local variable to create and store output file
    $filename = Get-Date -Format o | foreach {$_ -replace ":", ""}
    $result = "<Local folder path>"+$filename+".txt"

    #SMTP and Inbox details
    $smtp = "<smtpserver>"
    $from = "<Tenant admin account>"
    $to = "<Tenant admin account or whom the email to be sent>"
    $subject = "Alert : PFA Site Collection Quota Usage details"
    $body = "PFA quota usage details"

    #Enumerating all site collections and calculating storage usage
    $sites = Get-SPOSite -detailed
    foreach ($site in $sites)
    {
    $percent = $site.StorageUsageCurrent / $site.StorageQuota * 100
    $percentage = [math]::Round($percent,2)
    Write-Output "$percentage % $($site.StorageUsageCurrent)kb of $($site.StorageQuota)kb $($site.url)" | Out-File $result -Append
    }

    #Sending email with output file as attachment
    sleep 5
    Send-MailMessage -SmtpServer $smtp -to $to -from $from -subject $subject -Attachments $result -body $body -Priority high
  3. Where:

    • <GA Account or Tenanat Admin> is the global admin or the tenant admin account for your site collection.

    • <Password> is the password for the global or tenant admin account that you use in your site collection.

    • <SharePoint Admin Center Url> is the URL for your SharePoint Admin Center.

    • <Local folder path> is the local path for the folder where you want the data saved.

    • <smtpserver> is the name of your SMTP mail server.

    • <Tenant admin account> is the account that appears in the From line in the warning email.

    • <Tenant admin account or whom the email to be sent> is the account that will receive the email warning.

  4. In SharePoint Online Management Shell, change to the local directory where you saved the script file.

    ./GetEmailWarning.ps1

    After the script successfully completes, a text file is created in the location that you specified in the <Local folder path> variable in the script.

The SharePoint Online storage quota has not changed but a different metric is used. Previously, SharePoint storage was calculated in megabytes (MB) and now it's calculated in gigabytes (GB), using only full integers. If you previously set your storage quota in MB, it will be converted to GB (1024 MB=1 GB) and rounded down to the nearest integer. So a value of 5000 MB becomes 4 GB. A minimum of 1 GB can be set per site collection. If you set your SharePoint Online storage quota by using PowerShell, that value will be rounded up to the nearest integer GB to prevent a value of less than one GB turning into 0 GB.

The short icon for LinkedIn Learning. New to Office 365?
Discover free video courses for Office 365 admins and IT pros, brought to you by LinkedIn Learning.

See Also

SharePoint Online Limits

No comments:

Post a Comment