Link to home
Start Free TrialLog in
Avatar of STEVEO
STEVEO

asked on

Exporting list of users from AD groups and OUs?

I have often been asked to export a list of users from Distribution and security groups and OUs in Active Directory.

I tried the following code:

ldifde -f C:\ldif\ExportUsers.ldf –s SERVERNAME -d "OU=Test OU,dc=Company,dc=com" -p subtree -r "(objectClass=User)" -l "cn,givenName,Title,SamAccountName"

But I got a list of all users in the domain rather than just the OU, Anyone know what I did wrong?

Is there a better tool to use than LDIFDE?
ASKER CERTIFIED SOLUTION
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial