Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 606
  • Last Modified:

Script to export usernames and security group

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
gmllewellyn
Asked:
gmllewellyn
  • 2
3 Solutions
 
George K.Commented:
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
 
George K.Commented:
0
 
trythisoneCommented:
You could use dsquery and desget commands:

dsquery group -name Admin* |dsget group -members
0
 
Chris DentPowerShell DeveloperCommented:
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now