Solved

Script to export usernames and security group

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Join & Write a Comment

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…

758 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

20 Experts available now in Live!

Get 1:1 Help Now