SOLVED

license

Brass Contributor

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
}

 

1 Reply
best response confirmed by Rising Flight (Brass Contributor)
Solution

@Rising Flight 

 

That will work!

1 best response

Accepted Solutions
best response confirmed by Rising Flight (Brass Contributor)
Solution