Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 891
  • Last Modified:

Script Required to Export Group members of a Security Group

Hi Techs,

I have a Security groups created in My AD which has few other groups as its members.
Now I need to Export the user names for these security groups in to a CSV or text file

Thanks in Advance.

Regards,
Sesh..
0
Seshadrim
Asked:
Seshadrim
1 Solution
 
Sarang TinguriaSr EngineerCommented:
Use this

dsquery group -samid "Group Name" | dsget group -members | dsget user -display -email >C:\GroupName.csv

Open in new window

0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Tackle projects and never again get stuck behind a technical roadblock.
Join Now