0
votes

I am getting the plain Jane list of users that I want to join to my apps security list of users.

I am porting the db from one server to a new one, this code works in old and fails in new :)

select * from OPENQUERY(ADSI, 'SELECT cn, company, department, displayname, distinguishedname, givenname, HomeDirectory, HomeDrive, mail, manager, name, samaccountname, sn, title, UserPrincipalName, telephonenumber FROM ''LDAP://DC=OurName,DC=OurPlace'' WHERE objectCategory = ''person'' AND objectClass = ''user'' ' ) AS A

The new server will start to receive the list, you see it in the display grind. Then poof it is gone and it will then display this error: Msg 7330, Level 16, State 2, Line 1 Cannot fetch a row from OLE DB provider "ADsDSOObject" for linked server "ADSI".

It appears to be identical setups of the linked server. The old one pulls 1000 rows.

What should I be looking at?

TIA

1

1 Answers

0
votes

I suppose that you have a linked server for the active directory like I have. The linked server has a security context where you should set the user and the password that will be used while querying the active directory.

The user you are using for the linked server is probably different, having insufficient rights to query your AD.