Hello Alexander Andro Jae Diaz,
Wishing you a good day!
Get-RetentionCompliancePolicy
shows summary values unless you tell it to pull the distribution details. Microsoft’s own help says that without the extra switch *“the values of the DistributionStatus and Location property values will be inaccurate.” For more information, please visit this link.
Because of that, every Location and LocationException property comes back as an empty hash table {}
, even when the policy clearly targets (or excludes) something in the UI.
What to run instead
Get-RetentionCompliancePolicy -Identity "My Policy Name" -DistributionDetail |
Format-List Name, ExchangeLocation*, SharePointLocation*, OneDriveLocation*, \
ModernGroupLocation*, SkypeLocation*
With the switch you’ll now see:
-
ExchangeLocation = {All}
or a list of mailboxes when Exchange is ON -
ExchangeLocation = {}
when Exchange is OFF (exactly what the toggle in the UI does) - Any
*LocationException
values if you excluded specific objects.
If you want rule-level detail (for example to inspect retention action, duration, etc.), follow up with:
Get-RetentionComplianceRule -Policy "My Policy Name" -DistributionDetail | fl
Is there any real limitation?
Location count – a static retention policy can contain up to 1000 Exchange mailboxes and 1000 OneDrive accounts. If you need more, split the scope across multiple policies or use an adaptive scope.
Otherwise, the cmdlet surfaces everything the UI does; you just have to remember the -DistributionDetail switch.
So the empty {}
you’re seeing isn’t a bug, just the “quick” output. I hope this helps.
Best regards,
Finn Dang