Sunday, March 25, 2012

Cannot reference new attribute in Active Directory

We have had an existing linked server that we used to query AD and everything was working as expected. We had to add a new attribute so the AD schema was extended.

Now when I try to reference the new field I get the following error:

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'ADsDSOObject' reported an error. The provider did not give any information about the error.
OLE DB error trace [OLE/DB Provider 'ADsDSOObject' IColumnsInfo::GetColumnsInfo returned 0x80004005: The provider did not give any information about the error.].

Here is the code that gives the error:

SELECT employeeNumber as Employee_Number,
NECASupervisor
FROM OpenQuery(ADSI,
'SELECT employeeNumber,NECASupervisor
from ''LDAP://OU=NECA,OU=UserAccounts,DC=neca,DC=pri''
')

This query works fine:

SELECT employeeNumber as Employee_Number
FROM OpenQuery(ADSI,
'SELECT employeeNumber
from ''LDAP://OU=NECA,OU=UserAccounts,DC=neca,DC=pri''
')

Note: The field NECASupervisor is the new AD attribute. It is in the UserAccounts OU. If I run the same type of query using VB script it finds the attribute.

Anyone have any ideas on this?


Thanks


It turns out that once the Sql Server was rebooted, the query was able to reference the new AD attributes.

No comments:

Post a Comment