This file contains 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} |