Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Hey, we need to get distribution group manager name.
Code 1
Get-DistributionGroup -Identity 'PowerShell
Support' | Select -Property ManagedBy
Returns:
Array of Objects
ManagedBy
---------
{Venkatesan, C. (Chendrayan)}
We need to do more processing with display name. Remove {} and get only the display name.
Hold on- this is an array collection. What are you trying to do? What happens if you have more than one manager for a Distribution group?
We need to get Manager email ID.
Code 2
(Get-DistributionGroup -Identity 'PowerShell
Support').ManagedBy
Returns
Venkatesan, C. (Chendrayan)
Code 3
(Get-DistributionGroup -Identity 'PowerShell
Support').ManagedBy | %{Get-MailBox -Identity $_}
Code 4
(Get-DistributionGroup -Identity 'PowerShell
Support').ManagedBy | %{Get-Mailbox -Identity $_ | Select -Property PrimarySMTPAddress}
Enjoy PowerShell :)