12Knocksinna / Office365itpros

Office 365 for IT Pros PowerShell examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not Removing Service plans

kerravon67 opened this issue · comments

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

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 @()

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!