Forum Discussion
powershell: how to remove a calendar for many users?
Hi all,
I've hundreds users and they should remove a calendar (having the same name for each user) from their outlook.
No way to ask them to go into outlook doing right click - remove...
Any chances to go through powershell commands?
thanks!
mf
I'm not sure if you're talking about Exchange Server or Exchange Online - and I'm not particularly experienced with the latter, but with the former, you may be able to deal with this using Get-/Set-MailboxCalendarFolder and Get-/Set-MailboxFolderPermission.
It's been a fair while since I've worked with Exchange Server but I do remember having to set (which includes removing) the permissions a subfolder within the mailbox calendar, too, but this may just be a relic from the past. The subfolder related to the free/busy information but the name of it just isn't coming to me at this point in time.
You might also want to drop the question into the Exchange forum, where the people that work with such things everyday might be of more assistance - particularly with Exchange PowerShell.
- Get-MailboxCalendarFolder (ExchangePowerShell) | Microsoft Docs
- Set-MailboxCalendarFolder (ExchangePowerShell) | Microsoft Docs
- Get-MailboxFolderPermission (ExchangePowerShell) | Microsoft Docs
- Set-MailboxFolderPermission (ExchangePowerShell) | Microsoft Docs
- Remove-MailboxFolderPermission (ExchangePowerShell) | Microsoft Docs
A good starting point would be to run Get-MailboxCalendarFolder -Identity "user:\Calendar", where "user" is the user who sent out the invitation, and see if anything shows up. Same thing for Get-MailboxFolderPermission (or the V2 equivalent of Get-EXOMailboxFolderPermission.)
These might help guide you on which Set- or Remove- command to follow up with. For example, back in the day (when I was young!), you'd usually find something had been granted on the ":\Calendar" mailbox folder in which case you'd remove it.
I haven't talked about the Get-/Set-/Remove-MailboxPermission commandlets here because they don't fit with the scenario you outlined about invitations being sent, but they are worth being aware of in case any stray users have been granted access to more than just the calendar.
Cheers,
Lain
- All users have a calender added in their Outlook profile from somebody? It's not a calender in their own Exchange mailbox?
- alemadamaCopper Contributor
hi Harm_Veenstra,
no somebody shared his calendar and they then accepted.
but for some reason if the owner remove the sharing, the calendar keep staying there...
I searched on the server but I didn't find anything
- LainRobertsonSilver Contributor
I'm not sure if you're talking about Exchange Server or Exchange Online - and I'm not particularly experienced with the latter, but with the former, you may be able to deal with this using Get-/Set-MailboxCalendarFolder and Get-/Set-MailboxFolderPermission.
It's been a fair while since I've worked with Exchange Server but I do remember having to set (which includes removing) the permissions a subfolder within the mailbox calendar, too, but this may just be a relic from the past. The subfolder related to the free/busy information but the name of it just isn't coming to me at this point in time.
You might also want to drop the question into the Exchange forum, where the people that work with such things everyday might be of more assistance - particularly with Exchange PowerShell.
- Get-MailboxCalendarFolder (ExchangePowerShell) | Microsoft Docs
- Set-MailboxCalendarFolder (ExchangePowerShell) | Microsoft Docs
- Get-MailboxFolderPermission (ExchangePowerShell) | Microsoft Docs
- Set-MailboxFolderPermission (ExchangePowerShell) | Microsoft Docs
- Remove-MailboxFolderPermission (ExchangePowerShell) | Microsoft Docs
A good starting point would be to run Get-MailboxCalendarFolder -Identity "user:\Calendar", where "user" is the user who sent out the invitation, and see if anything shows up. Same thing for Get-MailboxFolderPermission (or the V2 equivalent of Get-EXOMailboxFolderPermission.)
These might help guide you on which Set- or Remove- command to follow up with. For example, back in the day (when I was young!), you'd usually find something had been granted on the ":\Calendar" mailbox folder in which case you'd remove it.
I haven't talked about the Get-/Set-/Remove-MailboxPermission commandlets here because they don't fit with the scenario you outlined about invitations being sent, but they are worth being aware of in case any stray users have been granted access to more than just the calendar.
Cheers,
Lain
- mfranhind115Brass Contributor
Hi LainRobertson ,
we have exchange online (no dedicated server).
thank you for your suggestions, I will try and let you know!
mf
- gcsitadminCopper Contributor
mfranhind115 hi, were you able to resolve your issue? I'm having what I think is the same issue. I had an end user create and share out a calendar to about 10 people. She gave them each different permissions to the calendar (view, read, edit..). Anyway, I removed the calendar from her computer (outlook on the web and desktop version of outlook) so that she would stop using it and because I created a new globally managed M365 group to take it's place. About 5 minutes after I deleted it I realized that I should of removed everyone's permissions to the calendar prior to doing that because it's not going to delete for them!
Like you, trying to get them to remove it on there on is not going to happen so I was hoping to find a way on the backend? Any help from anyone is greatly appreciated!
Thanks!