What it is
A PowerShell script that uses the Microsoft Graph PowerShell module to find users assigned the WORKPLACE_ANALYTICS_INSIGHTS_USER service plan, resolves each user's manager with batched Graph requests, and exports PersonId, ManagerId, and Department to InsightsLicensedUsers.csv for the organizational data file used by Viva Insights.
Why use it
- Build the organizational data source for Viva Insights from the users who actually hold the Insights license.
- Batched manager lookups with retry on throttling keep runs on large tenants from timing out.
- Add more user properties by editing the
-Propertylist and the output object.
How to use it
- Install the Microsoft Graph PowerShell module.
- Run the script and sign in with consent for the
User.Read.Allscope. The CSV is written to the current directory:
.\Get-AllInsightsLicensedUsers.ps1Prerequisites
- Microsoft Graph PowerShell module
- Account that can consent to the User.Read.All Microsoft Graph scope