Forum Discussion
Remove-CalendarEvents cmdlet does not work
- Nov 26, 2019
I had the exact same problem.
Then i noticed the error message always translating whatever timedate-string I attempted to use to my locale.
The error was introduced by some Microsoft Engineer unable to take into account the existence of other languages but US-English.
Try setting your region settings in the OS to US English. Then start a new powershell. Connect to Office 365. Issue the command.
- kirboroninNov 13, 2019Copper Contributor
Ricardo Viana yes, I thought about that weird us format too, but there is no difference between 4 Nov and 11 April, right?
Tried different dividers: ,./- with same error message: "Cannot convert value "11.4.2019 0.00.00"
VasilMichev that format "4 Nov 2019" returns completely the same error: "Cannot convert value "4.11.2019 0.00.00"
The problem is: that was warking even without -QueryStartDate parameter. And I can't find anything in MS documentation about any changes.
- Ricardo VianaNov 14, 2019Steel Contributor
It looks like you now need QueryStartDate and QueryWindowInDays (max value 1825). As you mentioned there is no documentation about this change and the Remove-CalendarEvents is not updated as well.
Ran it like this and it worked:
Remove-CalendarEvents -Identity user@domain.com -QueryStartDate 11/04/2018 -QueryWindowInDays 1825 -CancelOrganizedMeetings -PreviewOnly- kirboroninNov 14, 2019Copper Contributor
Ricardo Viana adding -QueryWindowInDays parameter does not change problem, that server does not accept date not in normal dd/mm/yyyy, nor in weird mm/dd/yyyy, nor in any other format.
Someone else met that problem and in discussion with MS support, I will follow this thread in hope of solution: https://www.reddit.com/r/PowerShell/comments/dvbqn2/getting_an_error_when_running_removecalendarevents/