Solved

Script to export usernames and security group

Posted on 2010-08-18
5
595 Views
Last Modified: 2013-12-24
Laddies and Gent’s,

I’m looking for a script that will query and export all users in our AD domain for all A* security groups.

The export ideally needs to lists the users and the security group that is associated with a*

For example:
user1 AB
user1 AC
user 2 AA
user 2 AC

500 points awarded
0
Comment
Question by:gmllewellyn
  • 2
5 Comments
 
LVL 13

Assisted Solution

by:George K.
George K. earned 332 total points
ID: 33463150
Use LDIFDE:
example:
Using the LDIFDE Utility
The LDAP Data Interchange Format (LDIF) is an Internet draft standard for a file format that can be used for performing batch operations on directories that conform to the LDAP standards. LDIF can be used to export and import data, allowing batch operations such as Add, Modify, and Delete to be performed in Active Directory. A utility called LDIFDE is included in the Windows 2000 operating system to support batch operations based on the LDIF standard. Using LDIF to Export All Objects in the Marketing OU
You can use LDIFDE to export all objects in the Marketing organizational unit (OU), created in " Step-by-Step Guide to Common Infrastructure Part 1". This example searches the organizational unit for certain objects and creates a file containing the names of those objects.
To export all objects in the Marketing OU
Click Start, point to Programs, then point to Accessories, and click Command Prompt.

At the command prompt, type:
ldifde -f marketing.ldf -s hq-res-dc-01-d"ou=Marketing,dc= reskit,dc=com"-psubtree–r"(objectCategory=CN=Person,CN=Schema,CN=Configuration,DC=reskit,DC=com)"

This creates a LDIF file named Marketing.ldf, by connecting to the server named HQ-RES-DC-01 and executing a subtree search of the Marketing OU for all objects of the category Person. (See Figure 1 below.)
 
the link:http://technet.microsoft.com/en-us/library/bb727091.aspx
0
 
LVL 13

Assisted Solution

by:George K.
George K. earned 332 total points
ID: 33463183
0
 
LVL 4

Accepted Solution

by:
trythisone earned 168 total points
ID: 33467761
You could use dsquery and desget commands:

dsquery group -name Admin* |dsget group -members
0
 
LVL 70

Expert Comment

by:Chris Dent
ID: 34608859
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Creating and Managing Databases with phpMyAdmin in cPanel.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now