Download the attendance reports of a Town Hall event using PowerShell - MgVirtualEventTownhallSession error

Gabriel Udrea 5 Reputation points
2025-02-06T15:24:02.3033333+00:00

Hi all,

I'm trying to download the attendance reports of a Town Hall event using PowerShell, because there's an issue with the interface as it only shows the 10 most recent log reports and there's no way to scroll back to the original one. Anyways, I was reding about some Graph APIs here:

https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.bookings/get-mgvirtualeventtownhallsessionattendancereport?view=graph-powershell-1.0

My issue is that I'm getting a Status: "404 (NotFound) ErrorCode: NotFound" when I try to query for the attendance report session using any of these 2 below:

Get-MgVirtualEventTownhallSessionAttendanceReport -VirtualEventSessionId $THSessionID -VirtualEventTownhallId $virtualEventTHID

Get-MgBetaVirtualEventTownhallSessionAttendanceReport -VirtualEventSessionId $THSessionID -VirtualEventTownhallId $virtualEventTHID

The event session id ($THSessionID) I'm getting using either one of these below (I get the same Id and there's only one session)

Get-MgVirtualEventTownhallSession
Get-MgBetaVirtualEventTownhallSession

Also, here you can see how I'm getting that session Id and the errorTH_info session

What do you think?

Thanks,
Gabriel

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,298 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.