Jul 03 2019 11:09 AM
Hi All
I want assign EMS license to 100 users and my users are in text file. The text file format is below. Will the below syntax work for me.
user
user1@abc.com
user2@abc.com
$LIC = New-MsolLicenseOptions -AccountSkuId "abc:EMS" -DisabledPlans "Service1","Service2","Service3"
$userlist = Get-Content -Path "C:\myusers.txt"
foreach ($user in $userlist){
Set-MsolUser -UserPrincipalName $user -UsageLocation "United Kingdom"
Set-MsolUserLicense -UserPrincipalName $user -AddLicenses "abc:EMS" -LicenseOptions $LIC
}
Jul 03 2019 11:49 AM
Solution