Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Active Dirctory Query

Author  Topic 

clarkbaker1964
Constraint Violating Yak Guru

428 Posts

Posted - 2005-11-18 : 16:35:19
Trying to run a query against Active Directory and compare with email's in database:

BOL:
OLE DB Provider for Microsoft Directory Services

EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5',
'ADSDSOObject', 'adsdatasource'
GO

SELECT [Name], SN [Last Name], ST State
FROM OPENQUERY( ADSI,
'SELECT Name, SN, ST
FROM ''LDAP://ADSISrv/ OU=Sales,DC=sales,DC=northwind,DC=com''
WHERE objectCategory = ''Person'' AND
objectClass = ''contact''')

LDAP information was changed to our servers but I can not query the linked server.


You can do anything at www.zombo.com
   

- Advertisement -