Quantcast
Channel: Microsoft Online: SharePoint Online forum
Viewing all articles
Browse latest Browse all 10096

Does this script work for clients who has unlimited storage in one drive?

$
0
0

How to set OneDrive for Business Storage Quota using PowerShell

#Step1: Get values for input parameters 
$Fulldomain="tenantname.onmicrosoft.com" 
$Quota="4096" 
 
#Step2: Connect to SharePoint Online and MsolService 
$credential = get-credential  
Connect-SPOService -Url “https://tenantname-admin.sharepoint.com/” -Credential $credential  
Connect-MsolService -Credential $credential 
 
#Step3: Set OneDrive Storage Quota for all Office 365 Users  
$users=Get-MsolUser 
$users | Foreach-Object{  
$user=$_ 
$username=($user.userprincipalname –Split “@”)[0] 
$Dname=($Fulldomain -Split "\."
If($Dname[2] -ne $null

$Firstname=$Dname[0] 
$Secondname=$Dname[1] 
$thirdname=$Dname[2] 
$sitename"https://"+$Firstname+"-my.sharepoint.com/personal/"+$username+"_"+$Firstname+"_"+$Secondname+"_"+$thirdname 

Else 

$Firstname=$Dname[0] 
$Secondname=$Dname[1] 
$sitename"https://"+$Firstname+"-my.sharepoint.com/personal/"+$username+"_"+$Firstname+"_"+$Secondname  

Set-SPOSite –Identity “$sitename” -StorageQuota $Quota 

Viewing all articles
Browse latest Browse all 10096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>