Link to home
Start Free TrialLog in
Avatar of smcdrc
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_CANTCONVERTVALUE]]

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
Avatar of Ted Bouskill
Ted Bouskill
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of smcdrc
smcdrc

ASKER

Thanks, Worked great the first time.
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.