Richard Parmiter

Virtualisation blog and Knowledge Base

  • You are here: 
  • Home
  • How to export the users of an AD Group.

How to export the users of an AD Group.

Posted on January 23rd, 2009

This is the best and fastest way to export all users who are members of a group

dsquery group “CN=Group Name,OU=OU Location,DC=Domain Name,DC=local” | dsget group -members | dsget user -samid -c >>c:\windows\temp\groupmembers.txt

If there are nested groups it might fail with the following error message:

The object class of the target does not match the one specified on the command line.

This error is removed by adding the -c variable as this continues despite the error.

  • Digg
  • StumbleUpon
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • Add to favorites
  • FriendFeed
  • Google Buzz
  • LinkedIn
  • Live
  • MySpace
  • Reddit
  • RSS

Tags: , , , , , ,
Filed under Scripts/Reg |

Leave a Reply