Can someone help me out with this? I have this code running fine on xp 32 bit, but on xp 64 bit "user.SetPassword" (not .Save()) throws an exception:
"Exception has been thrown by the target of an invocation."
{"Access Denied (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"}
The code:
UserPrincipal user = UserPrincipal.FindByIdentity
(new PrincipalContext(ContextType.Domain, Domain, "MYADMINUSER", "MYADMINPASSWORD"), IdentityType.SamAccountName, Account);
user.SetPassword("BlahBlahBlah");
user.Save();
Both Clients are in the same domain, and the target in both cases is the same user. "MYADMINUSER" can log in to both clients, and modify the target user using ADUC.
Any ideas?