IT민들레 - M365 Specialist

SharePoint Online 그룹/사이트 일괄 용량 변경 본문

Microsoft Office 365

SharePoint Online 그룹/사이트 일괄 용량 변경

IT민들레 2019. 4. 5. 11:14
728x90
반응형

How to Set Storage Quota for all Office 365 Groups

아래의 Step 1, 2, 3 을 copy 하여 사용하면 되고, 

PowerShell 에서 SharePoint Online Management Shell 사용을 위한 msi 파일을 설치하면 된다.

Following PowerShell script is used to Set Storage Quota for all Office 365 Groups. This script uses “Get-UnifiedGroup” to list all Office 365 groups, then uses “Set-SPOSite” to set StorageQuota and StorageQuotaWarningLevel for all Office 365 groups in the SharePoint Online tenant. Finally after setting storage quota, following information will be displayed as result: GroupName, StorageQuotaWarningLevel, CurrentStorage, and StorageQuota.

NOTE: It is recommended to execute the below script as .ps1 file with elevated privilege (Run as Administrator). Copy the below script to notepad and save it as .ps1 file or download .ps1 file from here

Step1: Get values for input parameters
$SPOAdminCenterUrl=Read-Host "Enter the admin URL(https://domainanme-admin.sharepoint.com):"
$Quota=Read-Host "Enter the Storage Quota value in MB:"
$WarningQuota=Read-Host "Enter the Warning Storage Quota value in MB:"
Import-Module Microsoft.Online.SharePoint.Powershell -Verbose
Step2: Connect to SharePoint Online using “Connect-SPOService” cmdlet
$credential = get-credential 
Connect-SPOService -Url $SPOAdminCenterUrl -Credential $credential 

Step3: To get all the Office 365 groups, we use “Get-UnifiedGroup” cmdlet, which depends on Exchange Online
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $credential -Authentication 
Basic -AllowRedirection
Import-PSSession $Session
$Groups=Get-UnifiedGroup
$Groups | Foreach-Object{
$Group = $_
$GName=$Group.Alias
$SiteURL=$Group.SharePointSiteUrl
If($SiteURL -ne $null){
Set-SPOSite -Identity $SiteURL -StorageQuota $Quota -StorageQuotaWarningLevel $WarningQuota
$site=Get-SPOSite -Identity $SiteURL -Detailed
      New-Object -TypeName PSObject -Property @{
      GroupName=$GName
      CurrentStorage=$site.StorageUsageCurrent
      StorageQuota=$site.StorageQuota
      StorageQuotaWarningLevel=$site.StorageQuotaWarningLevel
}}}|select GroupName, CurrentStorage, StorageQuota, StorageQuotaWarningLevel

source : https://www.jijitechnologies.com/blogs/how-to-set-storage-quota-for-office365-groups-in-sharepoint-online

SharePointOnlineManagementShell_8615-1200_x64_en-us.msi


728x90
반응형