What it is
A PowerShell sample that signs in interactively with MSAL.PS and calls the Yammer Network Data Export API for a date range. It downloads the export zip and writes a script log into a folder named for the export range. File attachments are only exported from legacy (pre-native mode) networks; native-mode networks return a files.csv with SharePoint and OneDrive links instead.
Why use it
- Export Viva Engage messages and related data for compliance, analytics, or archival needs.
- Limit the export to a start and end date, with an option to include file attachments from legacy networks.
- Detailed activity and error logging goes to a log file next to the export.
How to use it
- Create a Microsoft Entra app registration with the delegated Yammer
access_as_userpermission and install the module withInstall-Module MSAL.PS. - Set
$ClientId,$TenantId,$RedirectUri, and$rootPathnear the top of the script. - Run with a start date, plus an end date and
-IncludeFilesif needed. Keep the date range reasonable to avoid timeouts, and note that-IncludeFiles Allonly applies to legacy networks:
.\Export-EngageNetworkData.ps1 -startdate 2023-01-14 -enddate 2023-01-31 -IncludeFiles AllPrerequisites
- Microsoft Entra app registration with the delegated Yammer access_as_user permission
- MSAL.PS PowerShell module
- Viva Engage verified administrator account