Connect to Azure AD
Azure AD PowerShell Modunle
You need install MSOnline module only once. In the next time, run to connect to Azure AD PowerShell.
##Connect to MSOnline.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force;
Install-PackageProvider -Name NuGet -Force;
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted;
Install-Module -Name MSOnline;
Connect-MsolService;
Get-MsolAccountSku
Add a single license to all users
##Enter your SKU, you can get it using Get-MsolAccountSku command.
$AccountSKU = 'leoguides:DEVELOPERPACK_E5'
##Assign license for users
Import-Csv "C:\Temp\Users.csv" |
ForEach { Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $AccountSKU}
5/5 - (1 vote)