Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Accessing AD from SQL Server 2005 on Windows server 2003 Expand / Collapse
Author
Message
Posted Friday, April 10, 2009 9:42 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, April 18, 2013 1:23 PM
Points: 90, Visits: 286
SELECT [Name], SAMAccountName [AccountID]
FROM OPENQUERY( ADSI,
'SELECT Name, SAMAccountName
FROM ''LDAP://DC=corporate,DC=CC,DC=local''
WHERE objectCategory = ''Person'' AND
objectClass = ''user'' ')
runs from SQL Server 2005 on a Windows XP laptop
but does not run on SQL Server 2005 on a Windows Server 2003 box.
The error I received reads:
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "ADSDSOObject" for linked server "ADSI".

Any ideas why I am getting that error? Thanks
Post #695128
Posted Monday, April 13, 2009 6:38 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Thursday, December 18, 2014 8:26 AM
Points: 10,381, Visits: 13,436
What account is the SQL Server running under?

Is the provider for Active Directory installed on the server?




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #695701
Posted Monday, April 13, 2009 8:00 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, April 18, 2013 1:23 PM
Points: 90, Visits: 286
Is there a way to find out if Active Directory provider is installed on the SQL server box? (find out if Adsldp.dll, Adsldpc.dll, Adsmsext.dll, and Activeds.dll exist?)

Also our group has had a turnover. Is there a way for me to query what account SQL Server runs under( Network Service, LocalSystem etc...)

Thanks
Post #695818
Posted Monday, April 13, 2009 8:54 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Thursday, December 18, 2014 8:26 AM
Points: 10,381, Visits: 13,436
I'd just check using SSMS for the ADsDSOObject in the provider under the LinkedServers Providers node to see if the provider is installed.

What is the security set on the ADSI linked server?




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #695865
Posted Monday, April 13, 2009 8:57 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, April 18, 2013 1:23 PM
Points: 90, Visits: 286
SSMS for the ADsDSOObject exists on the list of providers.

security set on the ADSI linked server is use identity
where the identity is a domain service account that can read Active Directory. Thanks
Post #695869
Posted Tuesday, April 14, 2009 10:10 AM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, September 22, 2010 3:05 AM
Points: 83, Visits: 172
First of all define a Linked Server to the Active Directory Services using the below t-sql command.

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

Enable QPENQUERY in SQL Server 2005 and run QPENQUERY T_SQL Statements


Then try running the below LDAP SELECT queries using t-sql OPENQUERY command.

Be aware that, Microsoft SQL Server 2005 by default prevents the usage of "OpenQuery", in a way OpenQuery is disabled by default.

You might have to run the below t-sql script batch in order to enable OpenQuery in a MS SQL Server instance.
/*
sp_configure 'show advanced options', 1
reconfigure with override

sp_configure 'Ad Hoc Distributed Queries', 1
reconfigure
*/

SELECT * FROM OpenQuery(ADSI, 'SELECT * FROM ''LDAP://DC=myserver,DC=com'' WHERE objectCategory=''user'' ')

SELECT * FROM OpenQuery(ADSI, 'SELECT mail, displayName, userPrincipalName FROM ''LDAP://DC=myserver,DC=com'' WHERE objectCategory=''user'' ')
You can see that you should use the attribute names properly in the t-sql OPENQUERY statements.
Post #696731
Posted Wednesday, April 15, 2009 9:16 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, April 18, 2013 1:23 PM
Points: 90, Visits: 286
Thanks to everyone for the help. It turned out to be a mutiple hops issue and my company does not use Kerberos. Thanks!
Post #697629
Posted Thursday, July 9, 2009 8:00 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Monday, December 8, 2014 7:59 AM
Points: 405, Visits: 1,139

Hi hopefully someone can help me with this as well.

as above, I'm trying to query my LDAP server.

This is what I have setup:

I have access to our Active Directory and can view users and machines in active directory

- SQL Server 2005 Develper Edition installed on my machine.

- All services started.
SQL Server, SQL Server Agent, SSAS, SQL Server Browser, SQL Full Text Search & SQL Server VSS Writer all started as Local System
SSIS is started as Network Service

- OpenQuery is enabled
(I can run open query commands to other systems)

- I have defined a AD linked server as follows:
EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5', 'ADSDSOObject', 'adsdatasource'

- Having configure the linked server I have run the following query:
select * from openquery
(ADSI,'SELECT cn, mail, co, distinguishedName, displayName
FROM "LDAP://DC=MyDOMAIN,DC=net" where objectClass = "User" ')

where the domain is MyDOMAIN.NET.

I get the error:
Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "SELECT cn, mail, co, distinguishedName, displayName
FROM "LDAP://DC=MyDOMAIN,DC=net" where objectClass = "User" " for execution against OLE DB provider "ADSDSOObject" for linked server "ADSI".

What is: MSSQLServerADHelper - should this be started??
How do I know if SQL Server is operating in Kerboros mode - where do I change it?
Have I missed anything else??

Sorry - I know this has been covered several times, but I' struggling to see what the issue is!


_____________________________________________________________________________
MCITP: Business Intelligence Developer (2005)
Post #750249
Posted Thursday, July 9, 2009 8:00 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Monday, December 8, 2014 7:59 AM
Points: 405, Visits: 1,139

Hi hopefully someone can help me with this as well.

as above, I'm trying to query my LDAP server.

This is what I have setup:

I have access to our Active Directory and can view users and machines in active directory

- SQL Server 2005 Develper Edition installed on my machine.

- All services started.
SQL Server, SQL Server Agent, SSAS, SQL Server Browser, SQL Full Text Search & SQL Server VSS Writer all started as Local System
SSIS is started as Network Service

- OpenQuery is enabled
(I can run open query commands to other systems)

- I have defined a AD linked server as follows:
EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5', 'ADSDSOObject', 'adsdatasource'

- Having configure the linked server I have run the following query:
select * from openquery
(ADSI,'SELECT cn, mail, co, distinguishedName, displayName
FROM "LDAP://DC=MyDOMAIN,DC=net" where objectClass = "User" ')

where the domain is MyDOMAIN.NET.

I get the error:
Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "SELECT cn, mail, co, distinguishedName, displayName
FROM "LDAP://DC=MyDOMAIN,DC=net" where objectClass = "User" " for execution against OLE DB provider "ADSDSOObject" for linked server "ADSI".

What is: MSSQLServerADHelper - should this be started??
How do I know if SQL Server is operating in Kerboros mode - where do I change it?
Have I missed anything else??

Sorry - I know this has been covered several times, but I' struggling to see what the issue is!


_____________________________________________________________________________
MCITP: Business Intelligence Developer (2005)
Post #750250
Posted Thursday, July 9, 2009 8:02 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Monday, December 8, 2014 7:59 AM
Points: 405, Visits: 1,139
Hi hopefully someone can help me with this as well.

as above, I'm trying to query my LDAP server.

This is what I have setup:

I have access to our Active Directory and can view users and machines in active directory

- SQL Server 2005 Develper Edition installed on my machine.

- All services started.
SQL Server, SQL Server Agent, SSAS, SQL Server Browser, SQL Full Text Search & SQL Server VSS Writer all started as Local System
SSIS is started as Network Service

- OpenQuery is enabled
(I can run open query commands to other systems)

- I have defined a AD linked server as follows:
EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5', 'ADSDSOObject', 'adsdatasource'

- Having configure the linked server I have run the following query:
select * from openquery
(ADSI,'SELECT cn, mail, co, distinguishedName, displayName
FROM "LDAP://DC=MyDOMAIN,DC=net" where objectClass = "User" ')

where the domain is MyDOMAIN.NET.

I get the error:
Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "SELECT cn, mail, co, distinguishedName, displayName
FROM "LDAP://DC=MyDOMAIN,DC=net" where objectClass = "User" " for execution against OLE DB provider "ADSDSOObject" for linked server "ADSI".


What is: MSSQLServerADHelper - should this be started??
How do I know if SQL Server is operating in Kerboros mode - where do I change it?
Have I missed anything else??

Sorry - I know this has been covered several times, but I' struggling to see what the issue is!


_____________________________________________________________________________
MCITP: Business Intelligence Developer (2005)
Post #750252
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse