The following command will list all users who have a retention policy applied to their mailbox:
Get-Mailbox -filter 'RetentionPolicy -like "*"' | Select-Object Name, RetentionPolicy
You can export that to a CSV if need be by using:
Get-Mailbox -filter 'RetentionPolicy -like "*"' | Select-Object Name, RetentionPolicy | Export-CSV C:\directory\file.csv
To identify which users don't have a retention policy applied to their mailbox the following command will assist:
Get-Mailbox -filter 'RetentionPolicy -eq $null' | Select-Object Name, RetentionPolicy
Again to export that to CSV you would use:
Get-Mailbox -filter 'RetentionPolicy -eq $null' | Select-Object Name, RetentionPolicy | Export-CSV C:\Directory\file.csv
No comments:
Post a Comment