{"id":8625,"date":"2025-03-04T22:24:32","date_gmt":"2025-03-04T22:24:32","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=8625"},"modified":"2025-03-04T22:24:33","modified_gmt":"2025-03-04T22:24:33","slug":"how-to-find-out-what-tenant-teams-meetings-are-from-after-migration","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/how-to-find-out-what-tenant-teams-meetings-are-from-after-migration","title":{"rendered":"How to find out what Tenant Teams Meetings are from After Migration"},"content":{"rendered":"\n<p>Thanks to Sean : <a href=\"https:\/\/seanmcavinue.net\/2024\/08\/04\/identify-what-tenant-teams-meetings-are-from\/\">Identify What Tenant Teams Meetings Are From \u2013 Sean McAvinue<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">$ClientID = \"xxxxxxxxx\"\n$TenantID = \"xxxxxxxxx\"\n$CertificateThumbprint =\"xxxxxxxx\"\n\nConnect-MgGraph -ClientID $ClientID -TenantId $TenantID -CertificateThumbprint $CertificateThumbprint\n\n##Show User list\n$User = get-mguser -All | Out-GridView -PassThru\n\n##Get all future calendar items in the users mailbox\n[array]$CalendarItems = Get-MgUserEvent -UserId $User.Id -All | ?{[datetime]$_.Start.DateTime -gt (Get-Date) -or $_.Recurrence.Range.EndDate -gt (Get-Date) -or $_.Recurrence.Range.Type -eq \"NoEnd\"}\n\n##Get the Teams Meeting Items\n[array]$TeamsMeetings = $calendarItems | ?{$_.Body.Content -like \"*https:\/\/teams.microsoft.com\/l\/meetup-join*\"}\n\n##Extract the meeting options URL from the body content\nforeach($meeting in $TeamsMeetings){\n    ##Remove everything before the URL\n\t$htmlContent = $meeting.Body.Content.ToString()\n\t\n# Try double-encoded pattern first (Tid%2522%253a%2522GUID%2522)\n    $MeetingTenantID = [regex]::Match($htmlContent, 'Tid%2522%253a%2522([0-9a-f-]{36})%2522').Groups[1].Value\n\t\n\tif (-not $MeetingTenantID) {\n    # Try single-encoded pattern (Tid%22%3a%22GUID%22)\n    $MeetingTenantID = [regex]::Match($htmlContent, 'Tid%22%3a%22([0-9a-f-]{36})%22').Groups[1].Value\n}\n\t\n\t\n\t\tif (-not $MeetingTenantID) {\n     # Try plain text parameter (tenantId=GUID)\n    $MeetingTenantID = [regex]::Match($htmlContent, 'tenantId=([0-9a-f-]{36})').Groups[1].Value\n}\n\n  \n   \n\t$TenantDetails = (Invoke-MgGraphRequest -Method GET -Uri \"https:\/\/graph.microsoft.com\/beta\/tenantRelationships\/findTenantInformationByTenantId(tenantId='$MeetingTenantID')\")\n\t$Meeting | Add-Member -MemberType NoteProperty -Name TenantDetails -Value $TenantDetails.tenantId -Force\n    $Meeting | Add-Member -MemberType NoteProperty -Name TenantDomainName -Value $TenantDetails.defaultDomainName -Force\n    $Meeting | Add-Member -MemberType NoteProperty -Name TenantDisplayName -Value $TenantDetails.displayName -Force\n    $Meeting | Add-Member -MemberType NoteProperty -Name HTMLMeeting -Value $htmlContent -Force\n\t$meeting | export-csv c:\\temp\\$($User.UserPrincipalName)_TeamsMeetings.csv -NoTypeInformation -Append\n\n}\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Thanks to Sean : Identify What Tenant Teams Meetings Are From \u2013 Sean McAvinue<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8625","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8625","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=8625"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8625\/revisions"}],"predecessor-version":[{"id":8627,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8625\/revisions\/8627"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=8625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=8625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=8625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}