Adsi Error 7301
Contents |
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the for execution against ole db provider "adsdsoobject" for linked server "adsi" . company Business Learn more about hiring developers or posting ads with us Server Fault Questions cannot fetch a row from ole db provider "adsdsoobject" for linked server "adsi" . Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; the provider indicates that the user did not have the permission to perform the operation it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top ADSI Linked Server: Why can I query cannot obtain the required interface ( iid_idbschemarowset ) AD in VBA, but not as a Linked Server? up vote 0 down vote favorite After all the reading and research I've done, this seems like the most logical place to post this question: Why can I query Active Directory using VBA, but not a Linked Server in SQL Management Studio 2012? First, I have been able to do this before, but many moons ago with SQL Server 2005. Here is the query I am
Active Directory Linked Server
attempting: SELECT * FROM OpenQuery( ADSI, 'SELECT displayName, title, department, employeeID, userAccountControl FROM ''LDAP://dc=testdomain'' WHERE objectCategory = ''Person'' AND objectClass = ''user'' AND userAccountControl=512') Here is the error I'm getting: Msg 7321, Level 16, State 2, Line 1 An error occured while preparing the query "SELECT displayName, title, department, employeeID, userAccountControl FROM 'LDAP://dc=testdomain' WHERE objectCategory = 'Person' AND objectClass = 'user' AND userAccountControl=512" for execution against OLE DB provider "ADsDSOObject" for linked server "ADSI". The problem with this error message is that it's very generic and seemingly doesn't yield anything useful. Everything I've read appears to be a permission issue or the syntax of the query, and I assume it's meant in the context to my SQL instance login and how the security is set up in the Linked Server. The VBA code below works and is using a query that's very similar and not even the simplest of queries have worked in the Linked Server. I also have access to the Active Directory I am trying to link to and this is proven by the snippet of VBA code I have at the bottom (only there for reference). Thing is, I believe I have all the right privileges in place to for this to be working. However, a lot of what's being suggested is on different sites involves doing
(Русский)ישראל (עברית)المملكة العربية السعودية (العربية)ไทย (ไทย)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語) HomeLibraryLearnDownloadsTroubleshootingCommunityForums Ask a question Quick access Forums home Browse forums users FAQ Search related threads
Cannot Obtain The Required Interface ( Iid_idbschemarowset ) From Ole
Remove From My Forums Asked by: Get Active for execution against ole db provider adsdsoobject for linked server null Directory Users First/Last/Full Name thru Linked Server SQL Server > Transact-SQL Question 0 Sign sql server query active directory in to vote Hi There, I am trying to retrieve first/last/fullname of a login. I have succeeded in retrieving the displayname by http://serverfault.com/questions/673390/adsi-linked-server-why-can-i-query-ad-in-vba-but-not-as-a-linked-server means of the loginname, but the other names (first/last/full) a have some troubles with: I have created a linked server: -- Create Linked Server ADSI USE Master GO EXEC master.dbo.sp_dropserver @server = N'ADSI' GO EXEC master.dbo.sp_addlinkedserver @server = N'ADSI' , @srvproduct = N'Active Directory Services' https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3cc890ec-62f1-4b81-8786-2db31a1615e3/get-active-directory-users-firstlastfull-name-thru-linked-server?forum=transactsql , @provider = N'ADsDSOObject' , @datasrc = N'einstein.waterland.loc' --AKA the full computer name of the AD server Then I wrote this function: USE [ReportServer] GO ALTER Function [dbo].[AdUsers] ( ) RETURNS Table AS RETURN ( Select [Name] , [DisplayName] From OpenQuery ( ADSI,'SELECT name, displayname FROM ''LDAP://einstein.waterland.loc'' WHERE objectCategory = ''Person'' AND objectClass = ''user''') ) ============================================================================= This function is oké. But if I try to retrieve firstname, lastname or fullname in the function Like: From OpenQuery ( ADSI,'SELECT lastname, displayname FROM ''LDAP://einstein.waterland.loc'' WHERE objectCategory = ''Person'' AND objectClass = ''user''') ) I get the error: Msg 7399, Level 16, State 1, Procedure AdUsers, Line 8 The OLE DB provider "ADsDSOObject" for linked server "ADSI" reported an error. The provider did not give any information about the error. Msg 7350, Level 16
up Recent PostsRecent Posts Popular TopicsPopular Topics Home Search Members Calendar Who's On Home » SQL Server http://www.sqlservercentral.com/Forums/Topic167182-9-1.aspx 7,2000 » General » error 7301 error 7301 Rate Topic Display Mode Topic Options Author Message Jeff HawkinsJeff Hawkins Posted Friday, March 11, 2005 7:26 AM Forum Newbie Group: General Forum Members Last Login: Wednesday, February 3, 2016 1:36 PM Points: 1, Visits: 68 Good Morning,I am looking for some assistance.I have created a linked server as follows: EXEC sp_addlinkedserver 'ADSI','Active Directory linked server Services 2.5', 'ADsDSOObject', 'adsdatasource'I now go to EM and open the linked server, ADSI properties. I have no locallogins defined, I click the "Be made without using a security context". Ithen try to click on tables. I have also tried to use a security context.I get the following error: error 7301: Could not obtain a required interfacefrom OLE DB provider 'ADsDSOObject'PropertiesGeneral Tab:Linked Server:ADSIProvider ole db provider Name:ADsDSOObjectDatasource:adsdatasourceProvider String:Location:Catalog:On the server options tab, I have Data Access checked off.Sql Server Version: 7.0 Server O/S: NT SP 4Exchange Ver. 5.5 Server O/S: NTCan you please help? Any information may be useful.Thx,Jeff Post #167182 Site OwnersSite Owners Posted Monday, March 14, 2005 8:00 AM SSChampion Group: General Forum Members Last Login: Friday, May 18, 2007 3:36 PM Points: 10,041, Visits: 1 No one has responded to this topic yet. Even if you don't have a complete answer, the original poster will appreciate any thoughts you have! Post #167486 Huang JohnHuang John Posted Friday, July 15, 2005 9:35 AM Forum Newbie Group: General Forum Members Last Login: Wednesday, December 23, 2015 8:30 AM Points: 2, Visits: 122 Hi JeffI am new to using linked server to access AD. However after some poking around and Googling, I was able to do so.Here is what I have working for me:EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5', 'ADSDSOObject', 'adsdatasource' --I am not sure if it's case sensitive or not, I have seen some discussion on this issue. You can copy & paste to try it.EXEC sp_addlinkedsrvlogin 'ADSI', 'false', 'sa', 'YourDomain\AnyDomainAc