how search domain in active directory using sql server

Posted by Sagarp under Sql Server on 11/17/2009 | Views : 1605 | Status : [Member] | Replies : 2
HI


how search domain in active directory using sql server.how try display domain name using sql server ,reply which query i will be use reply.


Thanks
sagar

Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/



Responses

Posted by: Vuyiswamb on: 11/17/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
here is how its done

http://www.calazan.com/querying-active-directory-using-sql-server/

http://blog.tech-cats.com/2007/11/getting-enabled-disabled-active.html

http://msdn.microsoft.com/en-us/library/ms675090%28VS.85%29.aspx

Thank you for posting at dotnetfunda


Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Sagarp, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pandians on: 11/17/2009 [Member] [MVP] Silver

Up
0
Down
Hi Sagar

We have one Xtended SP.

DECLARE @DomainName varchar(50)

EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE',
@key='SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon',
@value_name='CachePrimaryDomain',
@value=@DomainName OUTPUT

SELECT @DomainName 'DomainName'

Cheers


Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Sagarp, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response