Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: DirectoryServices.DirectoryEntry.NativeObject.SetPassword()


Message #1 by "Tom Cammarano" <t.cammarano@c...> on Wed, 9 Oct 2002 09:33:37
I'm having trouble invoking the SetPassword method of a DirectoryEntry 
object's NativeObject property.

I've imported the Active Directory Service  COM type library into my ASP 
page (I'm using C#).

The following line takes the DirectoryEntry object representing a "user" 
and retrieves its native ADSI object:
ActiveDs.IADsUser iAdsUser = (ActiveDs.IADsUser) userDe.NativeObject;

Then I simply call the SetPassword method:
iAdsUser.SetPassword("blah");

The userDe object's username and password are set to username and password 
of the root domain DirectoryRntry.

Whe I call the SetPassword method I get a COMException: "Logon failure: 
unknown user name or bad password."

However I can call ChangePassword() and other methods and properties 
without any problems.

Can anyone help, please?

Regards,
Tom Cammarano

  Return to Index