Solved

Query Active Directory

Posted on 2010-08-23
4
839 Views
Last Modified: 2012-05-10
So I have gotten this far from information I have found but what I need to get is the names of the individuals that belong to this group and not the actual groupd name.  Don't query active Directory much so don't really know what I am doing.  How do i get the personnel whom belong to this group.

select cn, distinguishedName

from openquery(ADSI,'SELECT cn, distinguishedName

FROM "Sever Name"

WHERE objectCategory = ''group''

and CN = ''NGMN SEC J6 Voc''

')
0
Comment
Question by:kdeutsch
  • 3
4 Comments
 
LVL 6

Accepted Solution

by:
Jerryuk007 earned 400 total points
ID: 33501990
Have a look at spQueryAD (http://www.tek-tips.com/viewthread.cfm?qid=1273100&page=2)

I created that SP on MSSQL 2008, and then an SSIS to load the data into a MSSQL Table and sort them out the way I need.

Hope this helps.

Jerry
0
 

Author Comment

by:kdeutsch
ID: 33502973
Jerryuk007,

i will have to look into that for future use, currently I am trying to trace some Vb code that hits AD and gets the users that fall under this account and then emails them.  So I would have to put a lot of work into changing the whole thing, which I don't have time to do.  Just wondering if there is a way to get the users that belong to this distribution account.
0
 

Author Comment

by:kdeutsch
ID: 33513772
Came down to problem with account in AD, awarding Jerryuk007: some points for the code that will allow us to copy out Ad abojects.
0
 

Author Closing Comment

by:kdeutsch
ID: 33513799
Really was not the solution but wanted to award some popints for the code, but this question did not give me a choice to accept my solution and award points to others.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

746 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

12 Experts available now in Live!

Get 1:1 Help Now