#list service plan
Get-MsolAccountSku
Get-MsolAccountSku | Where-Object {$_.SkuPartNumber -eq “ENTERPRISEPACK”} | ForEach-Object {$_.ServiceStatus}
#assign license/disable some license options (only exchange online license as below)
$MyLicenseOptions = New-MsolLicenseOptions -AccountSkuId “tenantname:ENTERPRISEPACK” -DisabledPlans PROJECTWORKMANAGEMENT,SWAY,INTUNE_O365,YAMMER_ENTERPRISE,RMS_S_ENTERPRISE,OFFICESUBSCRIPTION,MCOSTANDARD,SHAREPOINTWAC,SHAREPOINTENTERPRISE
#assign license base above options
Set-MsolUserLicense -UserPrincipalName “[email protected]” -AddLicenses “tenantname:ENTERPRISEPACK” -LicenseOptions $MyLicenseOptions
#assign license from a .csv file
Import-Csv “C:\Scripts\MyO365Users.csv” | ForEach-Object { Set-MsolUserLicense -UserPrincipalName $_.MyUPN -AddLicenses “tenantname:ENTERPRISEPACK” -LicenseOptions $MyLicenseOptions }
https://blogs.technet.microsoft.com/treycarlee/2014/12/09/powershell-licensing-skus-in-office-365/