Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joerodgers/336acf4daa90aaefb08847be7def5dff to your computer and use it in GitHub Desktop.
Save joerodgers/336acf4daa90aaefb08847be7def5dff to your computer and use it in GitHub Desktop.
#requires -modules "Microsoft.Graph.Authentication"
function Get-TeamsMeetingId
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true)]
[Guid]
$UserObjectId,
[Parameter(Mandatory=$true)]
[int64]
$JoinMeetingId
)
begin
{
$uri = '/v1.0/users/{0}/onlineMeetings?$filter=joinMeetingIdSettings/joinMeetingId eq ''{1}''' -f $UserObjectId, $JoinMeetingId
}
process
{
$response = Invoke-MgRestMethod -Method GET -Uri $uri -Verbose
return $response.value.Id
}
end
{
}
}
function Invoke-TeamsMeetingTranscriptDownload
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true)]
[Guid]
$UserObjectId,
[Parameter(Mandatory=$true)]
[string]
$MeetingId,
[Parameter(Mandatory=$true)]
[string]
$OutputFilePath
)
begin
{
$uri = '/v1.0/users/{0}/onlineMeetings/{1}/transcripts' -f $UserObjectId.ToString(), $MeetingId
}
process
{
$response = Invoke-MgRestMethod -Method GET -Uri $uri -Verbose
Invoke-MgRestMethod -Method Get -Uri $response.value.transcriptContentUrl -OutputFilePath $OutputFilePath
}
end
{
}
}
Connect-MgGraph -ClientId "bf322415-5c0e-4698-a838-2b9610cf62f5" `
-CertificateThumbprint $env:CDX_THUMBPRINT `
-TenantId $env:CDX_TENANTID
$meetingId = Get-TeamsMeetingId -UserObjectId "a8734c7e-a19b-41c6-b384-5e550ca02b9f" -JoinMeetingId "23204592477"
Invoke-TeamsMeetingTranscriptDownload -UserObjectId "a8734c7e-a19b-41c6-b384-5e550ca02b9f" -MeetingId $meetingId -OutputFilePath "C:\_temp\transcript-01.vtt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment