Getting status of your Teams meeting invite (MS graph)
Just a small code to get a list of your meeting invitees and their responses to your meeting along with their designation and location. You can get other kind of data as well but this code is just to show how to combined two different cmdlets to get the final data
This doesn't need any special privileges in your tenant but you would need related Microsoft graph modules to be installed locally, either in system context or CurrentUser context
Connect-MgGraph -NoWelcome -scopes User.Read.All, Calendars.Read
# You would need to replace <user email id> and <meeting subject> with values
$meeting = Get-MgUserEvent -UserId (get-mguser -UserId <user email id>).Id -Filter "Subject eq '<meeting subject>'"
$AllUsers = $meeting.Attendees.emailAddress | ForEach-Object {
$User = Get-MGUser -UserId $_.Address -errorAction SilentlyContinue
[pscustomobject]@{
Email = $_.Address
JobTitle = $User.jobTitle
Location = $User.OfficeLocation
}
}
$meeting.Attendees | ForEach-Object {
$currentmail = $_.emailAddress.Address
$currentuser = $AllUsers | Where-Object {$_.Email -eq $currentmail}
[pscustomobject]@{
UserName = $_.emailAddress.Address
Response = $_.Status.response
Designation = $currentuser.JobTitle
OfficeLocation = $currentuser.Location
}
}