[SQL]SQL and Active Directory - How to use SQL to Query AD

2013-09-19

Situation:

Why just don't use AD management Tool or PowerShell to query rather than using MSSQL!!!

This's definitely a tough problem to figure it out. but I am an IT guy, when you are experiencing issues and need to engage it without serious irritative reaction

Solution:

Using LinkServer
 
1. Add Active Directory Link Server into MSSQL

(concise)
or

2. Add Link Server Account/Password (option)

 

3. Prepare your OpenQuery , default MSSQL not allow use OpenQuery
  • check status
 
  • using " Ad Hoc Distributed Queries" to open OpenQuery
 

4. Query your Active Directory

 

 *you can use "objectCategory" to shrink the Scope Range instead of using "objectClass"


Without Using LinkServer

1 comment

Unknown said...

IGT Gaming, Casinos, and Games for sale in Maricopa
Find your complete list of apr casino casinos, https://febcasino.com/review/merit-casino/ games and 토토 사이트 games at IGT Gaming https://deccasino.com/review/merit-casino/ in Maricopa, Arizona. 1. Casinos in Casino at jancasino.com Residence

Newer Older