Create automated usage report from Microsoft Teams
I am looking into a way to create an automated report that creates a usage report that you can run in the MS Teams admin center ‘https://admin.teams.microsoft.com/analytics/reports’ and somehow send that data in an email with a CSV or just sample report.
This would be a report for a call queue and not against a singular user etc.
From what I can see I can get the data like any usage report for a call queue and export it manually in the admin center but I can’t find any commands to trigger a usage report etc, but I can use Get-CSCallQueue to get info on a Call Queue.
Is there anyway to do this at all, maybe I could use an API but not touched that before and mostly use the Teams powershell Module.
https://learn.microsoft.com/en-us/powershell/module/teams/?view=teams-ps
I have a script I started working on but still testing it out.
# Specify the Call Queue ID
$CallQueueID = “”
# Retrieve the specific call queue
$callQueue = Get-CsCallQueue -Identity $CallQueueID
# Compile the data
$queueData = [PSCustomObject]@{
QueueName = $callQueue.Name
QueueID = $callQueue.Identity
# Add more fields as necessary
}
# Create an array to hold the report data
$report = @()
$report += $queueData
# Export the report to a CSV file
$report | Export-Csv -Path “C:PathToYourCallQueueReport.csv” -NoTypeInformation
# Output the report to the console (optional)
$report | Format-Table -AutoSize
I am looking into a way to create an automated report that creates a usage report that you can run in the MS Teams admin center ‘https://admin.teams.microsoft.com/analytics/reports’ and somehow send that data in an email with a CSV or just sample report. This would be a report for a call queue and not against a singular user etc. From what I can see I can get the data like any usage report for a call queue and export it manually in the admin center but I can’t find any commands to trigger a usage report etc, but I can use Get-CSCallQueue to get info on a Call Queue. Is there anyway to do this at all, maybe I could use an API but not touched that before and mostly use the Teams powershell Module. https://learn.microsoft.com/en-us/powershell/module/teams/?view=teams-ps I have a script I started working on but still testing it out. # Specify the Call Queue ID
$CallQueueID = “”
# Retrieve the specific call queue
$callQueue = Get-CsCallQueue -Identity $CallQueueID
# Compile the data
$queueData = [PSCustomObject]@{
QueueName = $callQueue.Name
QueueID = $callQueue.Identity
# Add more fields as necessary
}
# Create an array to hold the report data
$report = @()
$report += $queueData
# Export the report to a CSV file
$report | Export-Csv -Path “C:PathToYourCallQueueReport.csv” -NoTypeInformation
# Output the report to the console (optional)
$report | Format-Table -AutoSize Read More