Office 365: How to change Storage Quota in OneDrive for Business (I)!

If we wanto to change the storage quota for onedrive for Business (ODFB) in Office 365, we have to use PowerShell and the Set-SPOSite particular command. The following script shows how to allocate a quota of 500 MB to a particular ODFB site::How to update ODFB Storage Quota (Office 365)

function Set-OneDriveFBQuotaStorage

{

    param ($sUserName,$sMessage,$sSPOAdminCenterUrl,$sSPOODFBHostUrl,$sSPODFBRelativePath,$iODFBQuota)

    try

    {    

        Write-Host "----------------------------------------------------------------------------------"  -foregroundcolor Green

        Write-Host "Setting the Quota Storage for $sUserName ODFB" -foregroundcolor Green

        Write-Host "----------------------------------------------------------------------------------"  -foregroundcolor Green

        $msolCred = Get-Credential -UserName $sUserName -Message $sMessage        

        Connect-SPOService -Url $sSPOAdminCenterUrl -Credential $msolCred

        $sODFBSite=$sSPOODFBHostUrl + $sSPODFBRelativePath        

        Set-SPOSite –Identity $sODFBSite –StorageQuota $iODFBQuota         

        

        Write-Host "----------------------------------------------------------------------------------"  -foregroundcolor Green

        Write-Host "Storage Quota sucessfully update for $sUserName ODFB" -foregroundcolor Green

        Write-Host "----------------------------------------------------------------------------------"  -foregroundcolor Green

    }

    catch [System.Exception]

    {

        write-host -f red $_.Exception.ToString()   

    }    

}

 

#Connection to Office 365

$sUserName="<O365User>@<O365Domain>.onmicrosoft.com"

$sMessage="Introduce your SPO Credentials"

$sSPOAdminCenterUrl="https://<O365Domain>-admin.sharepoint.com/"

$sSPOODFBHostUrl="https://<O365Domain>-my.sharepoint.com/personal/"

$sSPODFBRelativePath="<O365User>_<O365Domain>_onmicrosoft_com"

$iODFBQuota=512000

 

Set-OneDriveFBQuotaStorage -sUserName $sUserName -sMessage $sMessage -sSPOAdminCenterUrl $sSPOAdminCenterUrl -sSPOODFBHostUrl $sSPOODFBHostUrl -sSPODFBRelativePath $sSPODFBRelativePath -iODFBQuota $iODFBQuota

Through Storage Metrics page for ODFB we can check if the storage quota has been updated correctly.

image

Office 365: Como cambiar la cuota de almacenamiento en OneDrive for Business (I)!

Si queremos cambiar la cuota de almacenamiento en OneDrive for Business (ODFB) en Office 365 de su valor por defecto (1 TB) a un valor inferior, tenemos que recurrir a PowerShell y en concreto al comando Set-SPOSite. El siguiente script muestra como asignar una cuota de 500 MB a un ODFB en concreto:How to update ODFB Storage Quota (Office 365)

function Set-OneDriveFBQuotaStorage

{

    param ($sUserName,$sMessage,$sSPOAdminCenterUrl,$sSPOODFBHostUrl,$sSPODFBRelativePath,$iODFBQuota)

    try

    {    

        Write-Host "----------------------------------------------------------------------------------"  -foregroundcolor Green

        Write-Host "Setting the Quota Storage for $sUserName ODFB" -foregroundcolor Green

        Write-Host "----------------------------------------------------------------------------------"  -foregroundcolor Green

        $msolCred = Get-Credential -UserName $sUserName -Message $sMessage        

        Connect-SPOService -Url $sSPOAdminCenterUrl -Credential $msolCred

        $sODFBSite=$sSPOODFBHostUrl + $sSPODFBRelativePath        

        Set-SPOSite –Identity $sODFBSite –StorageQuota $iODFBQuota         

        

        Write-Host "----------------------------------------------------------------------------------"  -foregroundcolor Green

        Write-Host "Storage Quota sucessfully update for $sUserName ODFB" -foregroundcolor Green

        Write-Host "----------------------------------------------------------------------------------"  -foregroundcolor Green

    }

    catch [System.Exception]

    {

        write-host -f red $_.Exception.ToString()   

    }    

}

 

#Connection to Office 365

$sUserName="<O365User>@<O365Domain>.onmicrosoft.com"

$sMessage="Introduce your SPO Credentials"

$sSPOAdminCenterUrl="https://<O365Domain>-admin.sharepoint.com/"

$sSPOODFBHostUrl="https://<O365Domain>-my.sharepoint.com/personal/"

$sSPODFBRelativePath="<O365User>_<O365Domain>_onmicrosoft_com"

$iODFBQuota=512000

 

Set-OneDriveFBQuotaStorage -sUserName $sUserName -sMessage $sMessage -sSPOAdminCenterUrl $sSPOAdminCenterUrl -sSPOODFBHostUrl $sSPOODFBHostUrl -sSPODFBRelativePath $sSPODFBRelativePath -iODFBQuota $iODFBQuota

A través de la página Storage Metrics para ODFB, comprobamos como la cuota de almacenamiento se ha actualizado de forma correcta.

image