Created
June 12, 2018 17:04
-
-
Save panreel/45a561e794f63d7e8626f0fd080ae3c7 to your computer and use it in GitHub Desktop.
Change ProPlus/standalone licenses to E3/ProPlus licenses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Connect to O365 Admin | |
Connect-MSolService | |
#Get company name | |
$accountSkus = Get-MsolAccountSku | |
$companyName = $accountSkus.AccountSkuId[0].split(":")[0] | |
$Office365ProPlusSku = $companyName + ":OFFICESUBSCRIPTION" | |
$Office365E3Sku = $companyName + ":ENTERPRISEPACK" | |
$Office365E3SkuServicePlansWithoutProPlus = "BPOS_S_TODO_2","FORMS_PLAN_E3","STREAM_O365_E3","Deskless","FLOW_O365_P2","POWERAPPS_O365_P2","TEAMS1","PROJECTWORKMANAGEMENT","SWAY","INTUNE_O365","YAMMER_ENTERPRISE","RMS_S_ENTERPRISE","MCOSTANDARD","SHAREPOINTWAC","SHAREPOINTENTERPRISE","EXCHANGE_S_ENTERPRISE" | |
#Get all licensed users - You can add more filters Get-MsolUser -All <more filters, e.g. -Department "Sales" -UsageLocation "US" | |
$x = Get-MsolUser -All | where {$_.isLicensed -eq $true} | |
#Create the E3 package with just ProPlus | |
$LO = New-MsolLicenseOptions -AccountSkuId $Office365E3Sku -DisabledPlans $Office365E3SkuServicePlansWithoutProPlus | |
#Remove ProPlus license for each user | |
$x | foreach { | |
if((Get-MsolUser -UserPrincipalName $_.UserPrincipalName).Licenses.AccountSkuId -eq $Office365ProPlusSku) | |
{ | |
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -RemoveLicenses $Office365ProPlusSku | |
Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $Office365E3Sku -LicenseOptions $LO | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cinefra like a Boss sempre il no.1 anche a sei mesi dalla dipartita