I have been able to get the members of the distro list via the command below but I am unable to figure out how to get the email addresses. Any ideas?
dsquery group -name "Distribution-list" | dsget group -members -expand
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
This will get you the email addresses and also expand the distribution group for subgroups.
dsquery group -name "group name"|dsget group -members -expand|dsquery user |dsget user -dn -samid -email