Cant delete Outlook web app policy that was accidentally created

Posted by ADynes@reddit | sysadmin | View on Reddit | 15 comments

So long story short people have been creating booking calendars left and right instead of just using the default booking with me calendar causing lots of extra unlicensed users to get created. Last Friday I deleted all those extra users and then turned off the ability to do it using:

set-OwaMailboxPolicy "Default" -BookingsMailboxCreationEnabled:$false

Unfortunately I used the exact command above instead of the correct:

set-OwaMailboxPolicy "OwaMailboxPolicy-Default" -BookingsMailboxCreationEnabled:$false

So it created a new policy called "Default" which I didn't notice for a couple hours. Once I realized it I tried deleting it and I got a error that it was in use. So to make sure it wasn't I ran:

Get-Mailbox -ResultSize unlimited | Set-CasMailbox -OwaMailboxPolicy "OwaMailboxPolicy-Default"

So every mailbox was set to the regular default. I then checked if anything still had the old one:

PS C:\Users\Me> Get-CASMailbox -ResultSize Unlimited | Where {$_.OwaMailboxPolicy -eq "Default"} | Select Name
PS C:\Users\Me>

Which returned nothing as it should. I then tried to delete it:

PS C:\Users\Me> Remove-OwaMailboxPolicy -Identity "Default"
Remove-OwaMailboxPolicy: ||Couldn't delete mailbox policy Default because it is associated with users.

Well I know that to not be true but figured with how Exchange Online works there is some syncing going on so I left it alone for 3 days and tried again this morning but got the same error.

What am I doing wrong?