Solved

Script to export usernames and security group

Posted on 2010-08-18
5
598 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Read about achieving the basic levels of HRIS security in the workplace.
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…

820 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