Nov 13 2019 05:33 AM
Nov 13 2019 05:33 AM
I used that several times and had a cheat-sheet with commands to clean recurring meetings of persons who has left the company.
That did not work the last time, returning error:
Remove-CalendarEvents -Identity firstname.lastname@example.org -CancelOrganizedMeetings -PreviewOnly Microsoft.Exchange.Entities.DataModel.InvalidRequestException: Your request can't be completed. The range between the start and end dates is greater than the allowed range. Maximum number of days: 1825
When I tried to specify time period, I got this:
Remove-CalendarEvents -Identity email@example.com -CancelOrganizedMeetings -QueryStartDate 4-11-2019 -PreviewOnly System.Management.Automation.ParentContainsErrorRecordException: Cannot process argument transformation on parameter 'QueryStartDate'. Cannot convert value "11.4.2019 0.00.00" to t ype "Microsoft.Exchange.ExchangeSystem.ExDateTime". Error: "String was not recognized as a valid DateTime.".
Again, that was working couple months ago just fine.
Nov 13 2019 08:34 AM
Nov 13 2019 10:40 PM - edited Nov 13 2019 10:41 PM
@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"
@Vasil Michev 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.
Nov 14 2019 12:40 AM - edited Nov 14 2019 12:41 AM
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 firstname.lastname@example.org -QueryStartDate 11/04/2018 -QueryWindowInDays 1825 -CancelOrganizedMeetings -PreviewOnly
Nov 14 2019 02:19 AM
@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_removecalendareven...
Nov 26 2019 04:56 AMSolution
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.
Nov 27 2019 12:16 AM