// methods for manipulating passwords internal override void SetPassword(AuthenticablePrincipal p, string newPassword) { Debug.Assert(p.fakePrincipal == false); Debug.Assert(p is UserPrincipal || p is ComputerPrincipal); // Shouldn't be being called if this is the case Debug.Assert(p.unpersisted == false); // ********** In SAM, computer accounts don't have a set password method if (p is ComputerPrincipal) { GlobalDebug.WriteLineIf(GlobalDebug.Warn, "SAMStoreCtx", "SetPassword: computer acct, can't reset"); throw new InvalidOperationException(SR.SAMStoreCtxNoComputerPasswordSet); } Debug.Assert(p != null); Debug.Assert(newPassword != null); // but it could be an empty string DirectoryEntry de = (DirectoryEntry)p.UnderlyingObject; Debug.Assert(de != null); SDSUtils.SetPassword(de, newPassword); }
internal override void SetPassword(AuthenticablePrincipal p, string newPassword) { DirectoryEntry underlyingObject = (DirectoryEntry)p.UnderlyingObject; this.SetupPasswordModification(p); SDSUtils.SetPassword(underlyingObject, newPassword); }
internal override void SetPassword(AuthenticablePrincipal p, string newPassword) { Debug.Assert(p.fakePrincipal == false); Debug.Assert(p != null); Debug.Assert(newPassword != null); // but it could be an empty string DirectoryEntry de = (DirectoryEntry)p.UnderlyingObject; Debug.Assert(de != null); SetupPasswordModification(p); SDSUtils.SetPassword(de, newPassword); }