Forum Discussion
Joe Henry
May 05, 2017Copper Contributor
The ManagedBy is not populating with the get-msolgroup command
When I run the get-msolgroup -grouptype distributionlist command, the managedby is always blank. does anyone know how I can get this resolved?
3 Replies
Sort By
The ManagedBy attribute is considered "expensive" and only returned when you run the cmdlet agains a single object. This will work:
Get-MsolGroup -GroupType DistributionList | select DisplayName,@{n="ManagedBy";e={(Get-MsolGroup -ObjectId $_.ObjectId).ManagedBy}}
Or if you want it in human-readable format:
Get-MsolGroup -GroupType DistributionList | select DisplayName,@{n="ManagedBy";e={(Get-MsolUser -ObjectId (Get-MsolGroup -ObjectId $_.ObjectId).ManagedBy).UserPrincipalName}}
- Nikhil PatilCopper Contributor
Um, you are not using the exact cmdlets, you have replaced the "DisplayName" with "Exchange", which is not a valid property. Copy/paste them as they are.