Forum Discussion

dannytveria's avatar
dannytveria
Brass Contributor
May 05, 2021

Remove licenses from users office 365

Hi,

I trying with no success to remove licenses from users.

I tried script from Microsoft docs but it`s not working.

I created txt file with the user upn.

after I runned the script I getting the next error:

Set-MsolUserLicense : User Not Found. User: .
At line:4 char:1
+ Set-MsolUserLicense -UserPrincipalName $x[$i] -RemoveLicenses "oranim ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Set-MsolUserLicense], MicrosoftOnlineException
+ FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.UserNotFoundException,Microsoft.Online.Administration.Automation.SetUserLicense

 

My target is to remove from Students users they license from txt file or csv file.

Thanks.

 

 

Resources