smcdrc
asked on
Query Active Directory and Return Member or MemberOf attributes
I am trying to query active directory to get the groups and their members. I am trying to conduct access reviews. When I try to get the 'member' attribute, I get the following error
Could not get the data of the row from the OLE DB provider 'ADSDSOObject'. Could not convert the data value due to reasons other than sign mismatch or overflow.
OLE DB error trace [OLE/DB Provider 'ADSDSOObject' IRowset::GetData returned 0x80040e21: Data status returned from the provider: [COLUMN_NAME=member STATUS=DBSTATUS_E_CANTCONV ERTVALUE]]
From what I understand, the member attribute is returned as an array. Is there a way to get that into SQL Server 2000? I know I can get this via .net, but I would like to keep it all in SQL Server.
Could not get the data of the row from the OLE DB provider 'ADSDSOObject'. Could not convert the data value due to reasons other than sign mismatch or overflow.
OLE DB error trace [OLE/DB Provider 'ADSDSOObject' IRowset::GetData returned 0x80040e21: Data status returned from the provider: [COLUMN_NAME=member STATUS=DBSTATUS_E_CANTCONV
From what I understand, the member attribute is returned as an array. Is there a way to get that into SQL Server 2000? I know I can get this via .net, but I would like to keep it all in SQL Server.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are welcome. This is a copy of what I did for someone else. The tricky bit was learning how to do LDAP queries.
I'm running the code exactly as shown above and although it appears to work fine it fails to return all the users in a group, stopping at 12 or 13 out of 22. Is there someting you are aware of that would prevent all users from being returned? Running a utility such as ldap.exe I am able to see all members of a group.
ASKER