Solved

Query Active Directory

Posted on 2010-08-23
4
842 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

895 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

19 Experts available now in Live!

Get 1:1 Help Now