Share via


Replace E1 with E3 License via CSV and Powershell

Replace E1 with E3 License
 1. Create CSV File for user UPN, save as replace.csv in folder C:\CSV

UPN
jcruz@contoso.com

  1. Save script below as .PS1 file and run in powershell

Connect-MSOLService
$users = import-csv C:\csv\replace.csv -delimiter ","
foreach ($user in $users) { $upn=$user.UPN
Set-MsolUser -UserPrincipalName $upn
Set-MsolUserLicense -UserPrincipalName $upn -RemoveLicenses "contoso:STANDARDPACK" -AddLicenses "contoso:ENTERPRISEPACK" }
Read-Host -Prompt "Press Enter to exit"