Forum Discussion

John Dole's avatar
John Dole
Copper Contributor
Aug 05, 2022

Microsoft Teams Shifts Distribution List

We have an oncall rotation and keep track of it using Microsoft Teams Shift.

 

I am trying to create a powershell script to update a distribution list so that whoever is on call gets notified if there is an issue.

 

My logic is a scheduled task that runs once a day to get who is scheduled for a shift (on call) and then updates a office 365 distribution list.  That way if there is an issue, only the people that are oncall get the email notification.

 

Updating the distro is really easy, but I am struggling getting the shift info from teams.

 

Using Get-MgTeamScheduleShift to list the shifts, but its not black and white - looks like the userID I have to get from Get-MgUser - I am not sure how to get the actual shift data though.

 

Please help!

Resources