管理网站存储限制Manage site storage limits

你的组织拥有的 Microsoft SharePoint 空间量基于你的许可证数量 (请参阅 SharePoint 限量) 。The amount of Microsoft SharePoint space your organization has is based on your number of licenses (see SharePoint Limits). 如果你是 Microsoft 365 中的全局管理员,你可以在你用完时 更改订阅的存储空间If you're a global admin in Microsoft 365, you can Change storage space for your subscription if you run out.

查看您的组织的总存储空间和可用存储空间View the total and available storage space for your organization

  1. 转到新的 SharePoint 管理中心的“活动网站”页,然后使用在组织中具有管理员权限的帐户进行登录。Go to the Active sites page of the new SharePoint admin center, and sign in with an account that has admin permissions for your organization.

备注

如果使用的是 Office 365 Germany,请登录 Microsoft 365 管理中心,然后浏览到 SharePoint 管理中心并打开“活动站点”页面。 If you have Office 365 Germany, sign in to the Microsoft 365 admin center, then browse to the SharePoint admin center and open the Active sites page.
如果使用的是由世纪互联(中国)运营的 Office 365,请登录 Microsoft 365 管理中心,然后浏览到 SharePoint 管理中心并打开“活动站点”页面。If you have Office 365 operated by 21Vianet (China), sign in to the Microsoft 365 admin center, then browse to the SharePoint admin center and open the Active sites page.

  1. 在页面的右上方,查看所有站点使用的存储量以及订阅的总存储空间。In the upper right of the page, see the amount of storage used across all sites, and the total storage for your subscription. (如果您的组织已在 Microsoft 365 中配置了多地理位置,则此栏还显示跨所有地理位置使用的存储量。 ) (If your organization has configured Multi-Geo in Microsoft 365, the bar also shows the amount of storage used across all geo locations.)

    "活动网站" 页面上的存储栏

    备注

    使用的存储不包括在过去的24-48 小时内所做的更改。The storage used doesn't include changes made within the last 24-48 hours.

设置自动或手动网站存储限制Set automatic or manual site storage limits

默认情况下,SharePoint 存储在所有网站都可以从中进行绘制的中央池中可用。By default, your SharePoint storage is available in a central pool from which all sites can draw. 作为全局或 SharePoint 管理员,不需要 divvy 存储空间或根据使用情况重新分配空间。You, as a global or SharePoint admin, don't need to divvy up storage space or reallocate space based on usage. 这将自动处理:网站在需要时使用所需的内容。That's all handled automatically: sites use what they need when they need it. 如果您以前手动设置了存储限制,并切换为使用池存储,SharePoint 会将所有限制重置为 25 TB (25600 GB) 。If you previously set storage limits manually and switch to using pooled storage, SharePoint resets all the limits to 25 TB (25600 GB). (请注意,您的组织的总存储空间可能小于 25 TB。 ) (Note that the total storage for your organization might be less than 25 TB.)

如果您希望微调分配给每个网站的存储空间,可以将存储管理选项设置为 "手动",并指定各个网站存储限制。If you prefer to fine tune the storage space allocated to each site, you can set your storage management option to "manual" and specify individual site storage limits.

备注

对于已选择加入到 Microsoft 365 中的目标发布选项的组织,将逐步引入某些功能。Some functionality is introduced gradually to organizations that have opted in to the Targeted release option in Microsoft 365. 这意味着您可能尚未看到本文中介绍的某些功能,或者它们可能看起来不同。This means that you might not yet see some features described in this article, or they might look different.

  1. 转到新的 SharePoint 管理中心的“设置”页,然后使用在组织中具有管理员权限的帐户进行登录。Go to the Settings page of the new SharePoint admin center, and sign in with an account that has admin permissions for your organization.

备注

如果使用的是 Office 365 Germany,请登录 Microsoft 365 管理中心,然后浏览到 SharePoint 管理中心并打开“设置”页面。 If you have Office 365 Germany, sign in to the Microsoft 365 admin center, then browse to the SharePoint admin center and open the Settings page.
如果使用的是由世纪互联(中国)运营的 Office 365,请登录 Microsoft 365 管理中心,然后浏览到 SharePoint 管理中心并打开“设置”页面。If you have Office 365 operated by 21Vianet (China), sign in to the Microsoft 365 admin center, then browse to the SharePoint admin center and open the Settings page.

  1. 选择 " 网站存储限制"。Select Site storage limits.

    管理网站存储限制

  2. 选择 " 自动 " 或 " 手动",然后选择 " 保存"。Select Automatic or Manual, and then select Save.

管理单个网站存储限制Manage individual site storage limits

当您的存储管理选项设置为 "手动" 时,请按照以下步骤指定各个网站存储限制。Follow these steps to specify individual site storage limits when your storage management option is set to "manual." 我们建议您同时设置电子邮件通知,以便在网站接近存储限制时,可以通知您和其他网站管理员。We recommend that you also set an email alert so that you and other site admins can be notified when sites are nearing the storage limit. 若要了解如何设置新网站的默认存储限制,请参阅 管理网站创建To learn how to set the default storage limit for new sites, see Manage site creation.

  1. 转到新的 SharePoint 管理中心的“活动网站”页,然后使用在组织中具有管理员权限的帐户进行登录。Go to the Active sites page of the new SharePoint admin center, and sign in with an account that has admin permissions for your organization.

备注

如果使用的是 Office 365 Germany,请登录 Microsoft 365 管理中心,然后浏览到 SharePoint 管理中心并打开“活动站点”页面。 If you have Office 365 Germany, sign in to the Microsoft 365 admin center, then browse to the SharePoint admin center and open the Active sites page.
如果使用的是由世纪互联(中国)运营的 Office 365,请登录 Microsoft 365 管理中心,然后浏览到 SharePoint 管理中心并打开“活动站点”页面。If you have Office 365 operated by 21Vianet (China), sign in to the Microsoft 365 admin center, then browse to the SharePoint admin center and open the Active sites page.

  1. 选择一个站点,然后选择 " 存储"。Select a site, and then select Storage.

    更改网站的存储限制

  2. 输入网站的最大存储空间(GB)。Enter the maximum storage in GB for the site.

    备注

    您可以输入的最大值为 25600 GB,但其空间可能大于贵组织所具有的空间。The max value you can enter is 25600 GB, although this may be more space than your organization has. 若要了解如何计算总存储空间,请参阅 SharePoint 限制To learn how your total storage is calculated, see SharePoint Limits.
    如果在 PowerShell 中设置了网站存储限制,请输入以 MB 为单位的存储限制。If you set site storage limits in PowerShell, you enter them in MB. 这些值将转换并向下舍入到最接近的整数,以在 SharePoint 管理中心的 GB 中显示。The values are converted and rounded down to the nearest integer to appear in GB in both the SharePoint admin center. 因此,5000 MB 的值将变为 4 GB。So a value of 5000 MB becomes 4 GB. 最小存储限制为 1 GB,因此,如果使用 PowerShell 设置的值小于 1024 MB,则会将其舍入为 1 GB。The minimum storage limit is 1 GB, so if you set a value of less than 1024 MB by using PowerShell, it will be rounded up to 1 GB.

  3. 请确保已启用 通知 ,以便在网站接近存储限制时向网站管理员发送电子邮件。Make sure Notifications is turned on to send an email to site admins when the site approaches the storage limit. 然后,输入一个值作为在发送电子邮件时所需的存储空间的百分比。Then, enter a value as a percent for how full you want the storage to be when the email is sent.

  4. 选择“保存”。Select Save.

如果网站耗尽存储空间,则网站管理员可以通过执行以下步骤来请求更多:If a site runs out of storage, site admins can request more by following these steps:

  1. 转到 "网站设置" 页。Go to the Site Settings page.
  2. 在 " 网站集管理" 下,选择 " 存储指标"。Under Site Collection Administration, select Storage Metrics.
  3. 在右上方选择 " 请求更多配额 "。Select Request more quota in the upper right.

这会将存储请求电子邮件发送到组织中的全局管理员和 SharePoint 管理员。This sends a storage request email to the global and SharePoint admins in the organization.

存储请求电子邮件

使用 PowerShell 监视网站存储限制Monitor site storage limits by using PowerShell

如果手动管理存储限制,则需要定期对其进行监视以确保它们不会影响网站性能。If you manage storage limits manually, you need to regularly monitor them to make sure they aren't affecting site performance. 我们建议您另外设置自己的警告电子邮件,以在网站达到限制之前通知网站管理员。We recommend that you also set up your own alert emails to notify site admins before a site reaches the limit. 通常每周为已到达指定警告等级的网站发送内置存储配额警告电子邮件。The built-in storage quota warning emails are typically sent weekly for sites that have reached the specified warning level. 因此,网站管理员通常会收到太晚的存储配额警告电子邮件。So site admins often receive the storage quota warning email too late. 例如,如果 "磁盘配额警告" 计时器作业 (将触发警告电子邮件) 按周计划,并每星期日发送一次电子邮件警告,但网站在星期一达到配额警告限制,则网站管理员不会收到6天的通知电子邮件。For example, if the Disk Quota Warning timer job (which triggers the warning email) is scheduled weekly and sends the email warning every Sunday, but a site reaches the quota warning limit on Monday, the site admin doesn't receive the alert email for 6 days. 在网站管理员收到通知电子邮件之前,此网站可能会达到最大存储限制,并将其设置为只读。This site could reach the maximum storage limit and be set to read-only before the site admin receives the alert email.

您可以使用以下 Microsoft PowerShell 脚本来监视网站。You can use the following Microsoft PowerShell script to monitor your sites. 此脚本将提取数据并撰写数据,然后向网站管理员发送存储警告警告。This script pulls the data, composes, and then sends a storage warning alerts to the site admin.

  1. 下载最新的SharePoint在线管理壳Download the latest SharePoint Online Management Shell.

    备注

    如果你已安装早期版本的SharePoint Online Management Shell,请进入添加或删除程序并卸载 "SharePoint Online Management Shell"。If you installed a previous version of the SharePoint Online Management Shell, go to Add or remove programs and uninstall "SharePoint Online Management Shell."
    在 "下载中心" 页面上,选择你的语言,然后单击 "下载" 按钮。On the Download Center page, select your language and then click the Download button. 系统会要求你下载 x64 和 x86 .msi 文件之间做出选择。You'll be asked to choose between downloading a x64 and x86 .msi file. 如果你运行的是64位版本的Windows,请下载x64文件,如果你运行的是32位版本,请下载x86文件。Download the x64 file if you're running the 64-bit version of Windows or the x86 file if you're running the 32-bit version. 如果你不知道,请参阅我运行的是哪个版本的 Windows 操作系统?If you don't know, see Which version of Windows operating system am I running?. 下载文件后,运行该文件并按照安装向导中的步骤进行操作。After the file downloads, run it and follow the steps in the Setup Wizard.

  2. 在Microsoft 365中,以全局管理员或SharePoint管理员连接到SharePoint。Connect to SharePoint as a global admin or SharePoint admin in Microsoft 365. 若要了解具体操作步骤,请参阅 SharePoint 在线管理壳入门To learn how, see Getting started with SharePoint Online Management Shell.

  3. 使用变量声明复制以下文本,并将其粘贴到文本编辑器(如记事本)中。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. 保存该文件,然后将其重命名为 "GetEmailWarning.ps1"。Save the file, and then rename it "GetEmailWarning.ps1".

    备注

    [!注意] 可以使用其他文件名,但是必须将文件保存为扩展名为 .ps1 的 ANSI 编码文本文件。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 SharePoint admin center using an admin account
#Specify the URL to your SharePoint admin center site, e.g. https://contoso-admin.sharepoint.com

$url = 'https://contoso-admin.sharepoint.com'

#Specify a folder path to output the results into
$path = '.\'

#SMTP details
$Smtp = '<SmtpServer>'
$From = '<SenderEmailAddress>'  
$To = '<RecipientEmailAddress>'
$Subject = 'Site Storage Warning'  
$Body = 'Storage Usage Details'

if($url -eq '') {
  $url = Read-Host -Prompt 'Enter the SharePoint admin center URL'
}

Connect-SPOService -Url $url

#Local variable to create and store output file  
$filename = (Get-Date -Format o | foreach {$_ -Replace ":", ""})+'.csv'  
$fullpath = $path+$filename

#Enumerating all sites and calculating storage usage  
$sites = Get-SPOSite
$results = @()

foreach ($site in $sites) {
  $siteStorage = New-Object PSObject
  
  $percent = $site.StorageUsageCurrent / $site.StorageQuota * 100  
  $percentage = [math]::Round($percent,2)

  $siteStorage | Add-Member -MemberType NoteProperty -Name "Site Title" -Value $site.Title
  $siteStorage | Add-Member -MemberType NoteProperty -Name "Site Url" -Value $site.Url
  $siteStorage | Add-Member -MemberType NoteProperty -Name "Percentage Used" -Value $percentage
  $siteStorage | Add-Member -MemberType NoteProperty -Name "Storage Used (MB)" -Value $site.StorageUsageCurrent
  $siteStorage | Add-Member -MemberType NoteProperty -Name "Storage Quota (MB)" -Value $site.StorageQuota

  $results += $siteStorage
  $siteStorage = $null
}

$results | Export-Csv -Path $fullpath -NoTypeInformation

#Sending email with output file as attachment  
Send-MailMessage -SmtpServer $Smtp -To $To -From $From -Subject $Subject -Attachments $fullpath -Body $Body -Priority high
  1. 其中:Where:
  • $url 是您的 SharePoint 管理中心的 url。$url is the URL of your SharePoint admin center. 如果该 $url 变量保留为空,则系统将提示您输入您的管理中心网站的 URL。If the $url variable is left empty, you will be prompted to enter the URL of your admin center site.

  • $path 是您希望 CSV 文件输出到的文件系统路径。$path is the file system path you want the CSV file to output to.

  • <SmtpServer> 是 SharePoint 迁移工具邮件服务器的名称。<SmtpServer> is the name of your SharePoint Migration Tool mail server.

  • <SenderEmailAddress> 是显示在警告电子邮件的 "发件人" 行中的全局管理员或 SharePoint 管理员帐户。<SenderEmailAddress> is the global admin or SharePoint admin account that appears in the From line in the warning email.

  • <RecipientEmailAddress> 是将接收电子邮件警告的管理员帐户。<RecipientEmailAddress> is the admin account that will receive the email warning.

  1. 在 SharePoint Online 命令行管理程序中,转到保存脚本文件的本地目录。In SharePoint Online Management Shell, change to the local directory where you saved the script file.
./GetEmailWarning.ps1

脚本成功完成后,将在脚本中的 $path 变量中指定的位置创建文本文件。After the script successfully completes, a text file is created in the location that you specified in the $path variable in the script.

备注

如果您收到一条错误消息 "无法运行脚本",则可能需要更改您的执行策略。If you get an error message about being unable to run scripts, you might need to change your execution policies. 有关信息,请参阅 关于执行策略For info, see About Execution Policies.