I have written a PowerShell script to add an end date to a recurring event for the Teams group of my choosing. The problem I am running into is when I run the Update-MgGroupEvent command, I get the following message:
Update-MgGroupEvent : Recurrence end date can not exceed Sep 1, 4500 00:00:00.
Here is the relevant line from my script:
Update-MgGroupEvent -EventId $mostRecentEvent.Id -GroupId $teamID -Recurrence $updateRecurrence
The variable $updateRecurrence is a hashtable that currently looks like this:
{
"range": {
"enddate": {
"DateTime": "2023-05-22T12:00:00",
"TimeZone": "Eastern Standard Time"
},
"type": "endDate"
},
"pattern": {
"DayOfMonth": 0,
"DaysOfWeek": [
"monday"
],
"FirstDayOfWeek": "sunday",
"Index": "first",
"Interval": 1,
"Month": 0,
"Type": "weekly"
}
}
The hashtable printout is courtesy of
Write-Host($updateRecurrence | ConvertTo-Json)
I'm a relative beginner with PowerShell, hashtables are new to me (although the key, value paradigm is quite familiar), and I'm just now getting into writing scripts using the MS Graph API. So, I will take no offense if you speak to me like you're explaining it to a first grader. 🙂
Also, I'm not sure whether or not the "pattern" part of the hashtable needs to be there since I am not updating anything.
Thanks,
John
Windows 10.0.19045, PowerShell 5.1.19041.2673