Solved

Query Active Directory

Posted on 2010-08-23
4
853 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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 shrink a transaction log file down to a reasonable size.

734 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