We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Export Users and Groups from AD

Medium Priority
569 Views
Last Modified: 2013-11-05
What command should I use in order to export from Active Directory the following information?:

all the groups and the users that belong to every group
all the users with the following attributes: username, full name, description, password expires option, password required, account disabled, account locked, last login
Comment
Watch Question

CERTIFIED EXPERT

Commented:
http://www.petri.co.il/using-csvde-ldifde-export-active-directory-snapshots-windows-server-2008.htm

There are a few issues here:
Last Login (lastLogon) isn't stored on one DC...however, you could use the lastLogonTimeStamp option (assuming you're on 2003 Native Mode).  This value is replicated by default every 2 weeks, so it's not very accurate for normal users.  It's used as a way to find stale accounts.

The userAccountControl uses a bitmask operator to determine quite a few things related to the user account status: (account disabled and pwd required, included)
http://msdn.microsoft.com/en-us/library/ms680832(v=vs.85).aspx

The utilities above will export everything you specify in the filter and attributes.
Adam BrownSenior Systems Admin
CERTIFIED EXPERT
Top Expert 2010

Commented:
If you download (and can install) the Quest Active Roles Powershell Cmdlets (available here:
http://www.quest.com/powershell/activeroles-server.aspx )

The attached scripts should pull the group information you want. I'll add another one in a second.
get-qadgroup | %{$group = $_.name
"_________" >> c:\groupstuff.csv
"$group" >> c:\groupstuff.csv
"_________" >> c:\groupstuff.csv
get-qadgroupmember $_.name| select name,type >> c:\groupstuff.csv}

Open in new window

Senior Systems Admin
CERTIFIED EXPERT
Top Expert 2010
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
thanks so much!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.