The repository contains the PowerShell script for reading the user purpose of the mailbox either for a specific user or for all users in the tenant.
- Register the app in Azure ADD with the following application permissions
- MailboxSettings.Read
- User.Read.All
- Create a new client secret
- Install the Microsoft.Graph PowerShell module
Get-UserMailboxSettingUserPurpose `
-ClientId "<client_id>" `
-TenantId "<tenant_id>" `
-Secret "<client_secret>" `
-UserId "<user_id> or <service_principal_name>"
Get-UsersMailboxSettingUserPurpose `
-ClientId "<client_id>" `
-TenantId "<tenant_id>" `
-Secret "<client_secret>" `