Jul 13 2020
02:43 AM
- last edited on
Feb 08 2023
10:08 AM
by
TechCommunityAP
Jul 13 2020
02:43 AM
- last edited on
Feb 08 2023
10:08 AM
by
TechCommunityAP
Hi,
Because of scheduling remote learning classes, the teachers has got numerous calendar events in their Teams calendar and its crashing the Teams app. Can somebody please help me with a powershell script to clear the calendar events for a list of users using input file (csv or txt).
Regards,
Muhamed
Jul 13 2020 03:39 AM
@muhamedrafeeq This shouldn't happen. File a support incident with Microsoft to have them investigate why the calendar is causing a problem.
Jul 15 2020 05:31 AM
Hi guys,
I really need to remove the calendar events for many staffs (o365 mailbox). Can somebody share a powershell script to do the same ?
Regards,
Rafeeq
Jul 15 2020 10:03 AM
@muhamedrafeeq have you tried using the Remove-CalendarEvents script ?
Jul 18 2020 06:45 AM
Hi @Ardamilola ,
Yes I tried the Remove-CalendarEvents script, but I believe that script is for future meetings and I want to clear the past meeting entries too. Also I got to clear calendar events for around 1000+ users. So a script which calls the input list would be feasible.
Dec 14 2020 08:38 PM
Hi @muhamedrafeeq and @Ardamilola,
Did you solve this problem?
I'm facing the exactly problem here.
I tried
Remove-CalendarEvents -Identity user@domain.com.br -CancelOrganizedMeetings -Confirm:$false -verbose
and
Get-Mailbox -ResultSize Unlimited | Search-Mailbox -SearchQuery "kind:meetings AND From:user@domain.com.br" -DeleteContent
But no success :(
Dec 15 2020 03:11 AM
The problem with Remove-CalendarEvents is that it's forward looking and I suspect that you want to remove events in the past. This can be done with the Search-Mailbox cmdlet using a command something like this:
Search-Mailbox -Identity MailboxtoSearch -SearchQuery 'Received:01-Jan-2019..15-Dec-2020 kind:meetings' -TargetFolder Searches -TargetMailbox AnotherMailbox -LogOnly -LogLevel Full
This command looks for calendar meeting events in a certain date range and creates a report in the target folder in the target mailbox. If you want to delete the items, run:
Search-Mailbox -Identity MailboxtoSearch -SearchQuery 'Received:01-Jan-2019..15-Dec-2020 kind:meetings' -DeleteContent
Dec 15 2020 10:22 AM
Thank you @Tony Redmond !
I issued this command
search-Mailbox -Identity user@domain.com.br -SearchQuery "kind:meetings" -DeleteContent -confirm:$false -Force
and Worked ! thank you for your time !
also I used -confirm:$false -Force because i needed to run in many users.
Thanks Again ! Best Regards !
Dec 16 2020 05:07 PM
@victor_fernande FYI, you might like the script described in How to Use PowerShell to Remove Calendar Items from Exchange Online