Forum Discussion

Joe Henry's avatar
Joe Henry
Copper Contributor
May 05, 2017

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

  • 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 Patil's avatar
      Nikhil Patil
      Copper Contributor

      Hello Vasil,

       

      I un the commands given by you, however it does not give output.

      • VasilMichev's avatar
        VasilMichev
        MVP

        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.

Resources