Microsoft Graph und CQD
Wer mit Microsoft Teams "telefoniert", findet jede Menge Verbindungsdaten im Teams Admin Center und in den CQD-Reports. Einige Daten können aber auch per Microsoft Graph abgerufen werden.
Call-Details mit Graph
Wenn Sie die verschiedenen Module der MGGraph-Powershell betrachtet haben, dann sollte ihnen auch Befehle mit "*-MgCommunicationCall*" aufgefallen sein. Sie können damit aus dem Teams Verbindungsdaten sehr einfach Details zu vergangenen Anrufen ermitteln.
Function Get-MgCommunicationCall 1.9.3 Microsoft.Graph.CloudCommunications Function Get-MgCommunicationCallAudioRoutingGroup 1.9.3 Microsoft.Graph.CloudCommunications Function Get-MgCommunicationCallOperation 1.9.3 Microsoft.Graph.CloudCommunications Function Get-MgCommunicationCallParticipant 1.9.3 Microsoft.Graph.CloudCommunications Function Get-MgCommunicationCallRecord 1.9.3 Microsoft.Graph.CloudCommunications Function Get-MgCommunicationCallRecordSession 1.9.3 Microsoft.Graph.CloudCommunications
Allerdings erwartet auch Get-MgCommunicationCall immer eine CallID. Es gibt aktuell (Stand Sep 2024) keine offizielle Schnittstelle, um alle Calls eines Unternehmens oder zumindest die Calls eines Benutzers zu erhalten. Siehe dazu auch
Die Commandlets haben eher das Ziel, aktuell aktive Calls zu erhalten und zu manipulieren. In dem Fall kann ich mir dann aber mit Invoke-MGGraphRequest behelfen.
$calls= Invoke-MGGraphRequest `
-Method GET `
-Uri "https://graph.microsoft.com/v1.0/communications/callRecords/getDirectRoutingCalls(fromDateTime=2022-03-10,toDateTime=2022-03-30)"
$calls.value[0]
Name Value
---- -----
mediaBypassEnabled True
callerNumber +495251304613
trunkFullyQualifiedDomainName sbc.uclabor.de
userPrincipalName frank.carius@uclabor.de
calleeNumber +49160906
signalingLocation EUWE
failureDateTime 10.03.2022 06:30:59
finalSipCodePhrase LocalUserInitiated
duration 0
callEndSubReason 0
successfulCall False
userId f2564fa9-fdc6-4db0-9d2a-a2dc940fbce4
correlationId 578c7283-6992-43b9-8dc3-8560767452ca
endDateTime
mediaPathLocation EUWE
userDisplayName Frank Carius
startDateTime
inviteDateTime 10.03.2022 06:30:21
finalSipCode 487
id 8cb8e505-7276-43bb-ac92-46698235b50f
callType ByotOut
Interessant ist hier die "id", welche die CallID ist, über die ich dann weitere API-Aufrufe starten kann. Entweder direkt:
$calldetail= Invoke-mggraphrequest `
-Method GET `
-Uri "https://graph.microsoft.com/v1.0/communications/callRecords/8cb8e505-7276-43bb-ac92-46698235b50f"
PS C:\> $calldetail
Name Value
---- -----
id 8cb8e505-7276-43bb-ac92-46698235b50f
version 5
participants {System.Collections.Hashtable, System.Collections.Hashtable, System.Collections.Hashtab…
joinWebUrl https://teams.microsoft.com/l/meetup-join/19%3ameeting_NWIxMTdiNzItYjNiYi00MzI1LTkxMmIt…
type groupCall
@odata.context https://graph.microsoft.com/v1.0/$metadata#communications/callRecords/$entity
lastModifiedDateTime 29.03.2022 17:50:17
endDateTime 29.03.2022 16:15:31
modalities {audio, video, videoBasedScreenSharing}
organizer {encrypted, acsApplicationInstance, device, spoolUser…}
startDateTime 29.03.2022 15:23:47
Oder mittels Get-MgCommunicationCallRecord
$calldetail= Get-MgCommunicationCallRecord `
-CallRecordId "8cb8e505-7276-43bb-ac92-46698235b50f" `
-ExpandProperty "sessions(`$expand=segments)"
EndDateTime : 29.03.2022 16:15:31
Id : 8cb8e505-7276-43bb-ac92-46698235b50f
JoinWebUrl : https://teams.microsoft.com/l/meetup-join/19%3ameeting_NWIxMTdiNzItYjNiYi00MzI1LTk
LastModifiedDateTime : 29.03.2022 17:50:17
Modalities : {audio, video, videoBasedScreenSharing}
Organizer : Microsoft.Graph.PowerShell.Models.MicrosoftGraphIdentitySet
Participants : {Microsoft.Graph.PowerShell.Models.MicrosoftGraphIdentitySet,
Microsoft.Graph.PowerShell.Models.MicrosoftGraphIdentitySet,
Microsoft.Graph.PowerShell.Models.MicrosoftGraphIdentitySet,
Microsoft.Graph.PowerShell.Models.MicrosoftGraphIdentitySet…}
Sessions : {0145bce7-3da6-4270-9c29-b62c320c3713, 04e18759-9cba-4c59-bdee-538caef52d06,
05f4c6e9-e8b9-47f3-aa13-99306b885c9c, 07ebc54a-4046-4f70-aa66-e5f5f9c6d047…}
StartDateTime : 29.03.2022 15:23:47
Type : groupCall
Version : 5
AdditionalProperties : {[@odata.context, https://graph.microsoft.com/v1.0/$metadata#communications/callRecords(sessions
(segments()))/$entity], [sessions@odata.context, https://graph.microsoft.com/v1.0/$metadata#comm
unications/callRecords('8cb8e505-7276-43bb-ac92-46698235b50f')/sessions(segments())]}
Sie sehen hier aber auch, dass die Rückgaben nicht identisch sind.
- Get-MgCommunicationCallRecord
https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.cloudcommunications/get-mgcommunicationcallrecord?view=graph-powershell-beta - Get-TeamsPSTNCallRecords
https://GitHub.com/leeford/Get-TeamsPSTNCallRecords















