12Knocksinna / Office365itpros

Office 365 for IT Pros PowerShell examples
MIT License
1.24k stars 559 forks source link

Not Removing Service plans #72

Closed kerravon67 closed 1 year ago

kerravon67 commented 1 year ago

I am using your Graph version of removing services to try to remove Microsoft Bookings from all of our users. The script runs fine without any errors and says it removed 748 licenses but when I look at a user in 365 Admin center Bookings is still checked. Am I doing something wrong? Thanks

kerravon67 commented 1 year ago

Update: When I run the Azure Ad and MSOL versions of the script it reports that no Bookings licenses were found. When I debug it seems to be failing on this statement...saying that the command is not recognized. Set-MgUserLicense -UserId $User.Id -AddLicenses $LicenseOptions -RemoveLicenses @()

kerravon67 commented 1 year ago

Update: I was running script in Windows Powershell ISE. I changed to running in Visual Studio Core with PS 7 and it is working. Thanks for the great script!