get properties of a distribution group

Hi - i am trying to find the description,RecipientPermission,displayname,managedby(owner),requiresenderauthenticationenabled(if allowed to send from outsider),Membercount,PrimarySMTP.

 

I am able to get get all but description and RecipientPermission from below. How do I incorporate that into the below?

 

[pre]Get-DistributionGroup -ResultSize unlimited | select DisplayName,Managedby,RequireSenderAuthenticationEnabled,@{n=“MemberCount”;e={(Get-DistributionGroupMember $_.PrimarySmtpAddress | measure).Count}},PrimarySmtpAddress | Export-CSV C:\DlistCleanup.CSV[/pre]

The command may not return that information. Have you tried:

 

Get-DistributionGroup -ResultSize unlimited | Format-List *

 

?

to get those results you would use get-adgroup and get-adpermissions for the description field and permissions

 

Don’s right, this worked for me: Get-DistributionGroup -ResultSize unlimited | Format-List DisplayName,Managedby,RequireSenderAuthenticationEnabled.

However, to get the member count of all Distribution groups is another process. Paul Cunningham can help you with that: https://practical365.com/exchange-server/get-distribution-group-member-counts-with-powershell/

Get-DistributionGroup -ResultSize unlimited | select DisplayName,Managedby,RequireSenderAuthenticationEnabled,@{n=“MemberCount”;e={(Get-DistributionGroupMember $_.PrimarySmtpAddress | measure).Count}},PrimarySmtpAddress | Export-CSV C:\DlistCleanup.CSV

The above works and returns the displayname, Managedby, Required Authentication Enabled, Memeber count and SMTP.

I also need the Description and Recipient Permission. How do i add this to the above script?

[quote quote=131127]to get those results you would use get-adgroup and get-adpermissions for the description field and permissions

[/quote]
thank you. But how can i add them to my script? I dont want to use a different script and pull both spreadsheets and compare. There are too many columns to go through.

I’m afraid that won’t work. Your custom property is using the command “get-distributiongroupmember” as the scriptblock expression for “MemberCount”. It’s not a property of the incoming objects produced by Get-DistributionGroup. You won’t get any results for member count.

actually this worked
Get-DistributionGroup -resultsize unlimited | select displayName,Managedby,Requ<wbr />ireSenderA<wbr />uthenticat<wbr />ionEnabled<wbr />,@{n=“Memb<wbr />erCount”;e<wbr />={(Get-Dis<wbr />tributionG<wbr />roupMember<wbr /> $.PrimarySmtpAddress | measure).Count}},@{n=“Desc<wbr />ription”;e<wbr />={(Get-adg<wbr />roup $.samaccountname -properties description).description}}<wbr />,PrimarySm<wbr />tpAddress,<wbr />AcceptMess<wbr />agesOnlyFr<wbr />omSendersO<wbr />rMembers | Export-CSV C:\DlistCleanup.CSV