是否可以像description,memberOf一样获取AD值的多值属性。如果我加入的memberOf运行简单,就是给了错误如何使用SQL从Active Directory中获取多值数据
select *
FROM OPENQUERY(ADSI,'SELECT initials, samAccountName, displayName, distinguishedName, mail, memberOf FROM ''LDAP://DC=corp, DC=contoso, DC=com'' WHERE objectClass=''Person''')
错误:
Msg 7346, Level 16, State 2, Line 1
Cannot get the data of the row from the OLE DB provider "ADSDSOObject" for linked server "ADSI". Could not convert the data value due to reasons other than sign mismatch or overflow.
这是因为的memberOf是在Active Directory中的多值属性。我正在使用SQL Server 2008 R2