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		
	}
}        

要查看或添加评论,请登录

Nitish Kumar的更多文章

  • Creating a Chart image in PowerShell

    Creating a Chart image in PowerShell

    As many of you know that PowerShell can tap into potential of .Net methods easily available with Microsoft Windows…

    2 条评论
  • PS script for horizontal tabbed HTML Report

    PS script for horizontal tabbed HTML Report

    It's just another version of the earlier PS script, to create the report with horizontal tabs this time. Likely in…

  • Tabbed HTML output by PS script

    Tabbed HTML output by PS script

    Just a weekend musing. Tried to create a function which if given array input with columns Title and content, then it…

  • Getting license report for O365 with real names

    Getting license report for O365 with real names

    I am sure most of you don't need my help in getting License report from O365 via PowerShell, I actually covered that in…

  • PS Script to get meeting details via graph

    PS Script to get meeting details via graph

    #PowerShell #MicrosoftGraph #Scripting I had posted about a simple script to get your meeting related details in…

  • Balloon notification with PowerShell

    Balloon notification with PowerShell

    What if you running a script which takes long time and covers various tasks, it can quickly get boring, and you don't…

  • How to handle credentials in PowerShell for unattended tasks?

    How to handle credentials in PowerShell for unattended tasks?

    Hard-coding credentials in script is considered cardinal sin and been the source of countless breaches. No matter, big…

  • Do you know you can encrypt a PowerShell script and run the encrypted script?

    Do you know you can encrypt a PowerShell script and run the encrypted script?

    #PowerShellTrick #Count1 Use case: You want to keep the script on a shared path so that it's accessible for running but…

    2 条评论
  • Microsoft Defender for Identity

    Microsoft Defender for Identity

    Why defender for identity? Security perimeter isn't physical or network anymore, but identity becomes another end, in a…

  • How to start with learning PowerShell?

    How to start with learning PowerShell?

    Learning a new language always looks messy, be it the case that you never knew programming or be it the case that you…

社区洞察

其他会员也浏览了