2

I am following this article below:

Querying Active Directory Data from SQL Server

and for me to get it right I need the following information below.

Querying Active Directory Once the linked server is created we can now setup our query to return the information we need.

First, you'll need to ask your Network/Systems Administrator for your LDAP info then we can continue to the query.

Here is how the LDAP connection is broken down:

For our example it looks like this:

LDAP://DOMAIN.com/OU=Players,

DC=DOMAIN,DC=com LDAP://Domain.com - is the name of a domain controller /OU=Players - this is the Organization Unit, in our case (Players) ,

DC - this is the Domain Name broken up by domain and extension name

So....LDAP://DomainControllerName.com/OU=OrganizationalUnit,DC=DOMAIN,DC=NAME

Considering that I have all the required permissions, how would I find all these required information stated above?

It could be through using powershell or any other way.

My preferred ways would be through scripting though.

  • 1
    I'd start with this.... Download and install the [Remote Server Administration Tools for Windows 10](https://www.microsoft.com/en-us/download/details.aspx?id=45520), and then once installed open **Users and Computers** and as long as you are logged onto the machine with a domain account of the domain which you wish to get the structure of AD to call via LDAP, this will allow you to see the correlated detail and structure of the OU's, etc. If you have a domain account, you automatically have read access to see and traverse the entire structure by default so give it a shot. – Vomit IT - Chunky Mess Style Jun 18 '17 at 00:51
  • 1
    You could always ask your system guys that maintain the domain controllers as well but I always just get this detail from AD Users and Computers and it's pretty easy. I think you can do an `nslookup ` from command line to get your domain controller name on the same network as the domain controllers. – Vomit IT - Chunky Mess Style Jun 18 '17 at 00:53

0 Answers0