Distribution list user’s details in active directory

Hi Guys,

I have a DL in Active directory and I need to export all the users in this DL

The outcome is to list Full name, userID,email Address,Company phone,Mobile,IPphone,devision , basically everything if that possible please

I prefer it to be done in PS

Thank you in advance
RabihhajIT HelpDeskAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike KlineCommented:
To start you can use

Get-ADGroupMember GroupName| get-aduser -properties *

Open in new window


That will show you available properties, you can then pick what you want for example

get-adgroupmember GroupName | get-aduser -properties * | select-object name, userprincipalname

Open in new window


I only picked a few properties but you get the idea

You can then export it

get-adgroupmember GroupName | get-aduser -properties * | select-object name, userprincipalname | export-csv -path  PathToFile -notypeinformation

Open in new window


Thanks

MIke
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RabihhajIT HelpDeskAuthor Commented:
Hi Mike
if I want to Export it to H drive   where do I replace the path example "H:\listodDL.csv"
0
Mike KlineCommented:
export-csv -path h:\listDL.csv

Thanks

Mike
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

RabihhajIT HelpDeskAuthor Commented:
Great solution
0
RabihhajIT HelpDeskAuthor Commented:
Hi Mike ,

sorry I trouble you again ,

is the above script will bring up all the sub DL and contact users also

Please advise  

Thanks
rabih
0
RabihhajIT HelpDeskAuthor Commented:
Hi Mike ,

Could you please assist me , I am running your above script to bring all the users in  sub-distribution lists which has multiple DL's nested inside  the main one  , for some reason did not bring up all the sub DL users , could you please assist ..


Thanks
Rabih
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.