I'm trying to read the groups that a user belongs to. This is for an
application running in ASP.NET, but I think my problem is with AD.
Here's my code:
///////////////////////////////////////////////////
DirectoryEntry aduser =
new DirectoryEntry( _path, username, pwd);
object groups = aduser.Invoke("Groups");
// ^-- causes error "Exception has been thrown by the
// target of an invocation."
///////////////////////////////////////////////////
Where "_path" is the distinguished name of the user, "username" and
"pwd" are the username and password of a domain user (I've tried the
domain administrator account, too, to rule out permissions issues).
I'm pretty sure that the problem is not from my DirectoryEntry
parameters as I'm able to retrieve other Properties from my aduser once
created.
I've also tried this method with a more descriptive error:
////////////////////////////////////////////////
DirectoryEntry aduser =
new DirectoryEntry( this._path, username, pwd);
IADsUser user = aduser.NativeObject as IADsUser;
object groups = user.Groups();
// ^-- returns error "Exception from HRESULT: 0x8000500C."
////////////////////////////////////////////////
----------------------------------------
http://members.tripod.com/kcourville0/
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Willy.
"Kenneth Courville" <kcour...@yahoo.com> wrote in message news:#fJl0pISCHA.2456@tkmsftngp08...