Get-RetentionCompliancePolicy Doesn't Return Values for SharepointLocation
I have added sites to a Preservation Policy and need to continue adding sites to new policies. To do this I'm employing Powershell and the Compliance Center cmdlets to automate the provisioning of new policies as the current policy fills with sites.
To do this I am running Get-RetentionCompliancePolicy and accessing the SharepointLocation property of the resultant objects. However, when I run the cmdlet without any arguments all the policies are returned, but the SharepointLocation property is empty. If I run the same cmdlet and pass in a policy name to the -Identity parameter then values are returned for the SharepointLocation property.
Thanks!
I previously posted this idea in the Office 365 Admin Uservoice portal, but I think it's more appropriate here.

Make sure to add the -DistributionDetail parameter
4 comments
-
ErgoBill commented
I have a question regarding this thread. I have applied the policy to "ALL" when setting up the RetentionCompliancePolicy in Sec&Comp . Client has a mix of E3 and Bus premium licenses. So how do I know which actual users in "All" are really getting the 7 yr retention applied to them? According to everything I read only E level licenses will have the retention policy effective.
-
Steve March commented
To get a list of users in a policy, I had to do the following:
$Mailboxes = (Get-RetentionCompliancePolicy -Identity "Policy" -DistributionDetail | Select -ExpandProperty ExchangeLocation)$(Foreach ($policyLocation in $Mailboxes) {
New-Object PSObject -Property @{
DisplayName = $policyLocation.DisplayName
UPN = $policyLocation.name
}
} ) | select-object -Property DisplayName, UPN | Export-Csv -Path "PolicyUsers.csv" -NoTypeInformation -
Rob Whaley [MSFT] commented
Get-RetentionCompliancePolicy -DistributionDetail Should give you the results your looking for.
-
Jibin Peng commented
Use the old way Get-HoldCompliancePolicy will do the trick