title: Make Win7 use new password without reboot or screen unlock
body: <p>We call DirectoryEntry.Invoke("SetPassword",newpwd) to change the password of a local user, but the new password is not being used immediately when doing Windows Authentication to a remote SQL server. It does get used after a reboot, but that's not really an option for me here. How can I make it take effect without rebooting? I need currently running processes on the client to begin using the new password immediately.</p>
  
  <p>The environment is two Windows 7 Embedded systems, call them 'server' and 'client', and there is no domain, but they are both in the same workgroup. We use the same username on both systems. There are multiple servers out there with different passwords (computed based on various things). When we need to switch to use a different server, we change the password locally. The change itself is successful, but SQL accesses from client to server fail with</p>
  
  <pre><code>SSPI handshake failed with error code 0x8009030c, state 14 while establishing a connection with integrated security; the connection has been closed. Reason: AcceptSecurityContext failed. The Windows error code indicates the cause of failure. 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
  </code></pre>
  
  <p>But as soon as client reboots it can access server's database successfully.</p>
  
  <p>SQL Express 2008 on both systems, configured to use only Windows Authentication.</p>
  
  <p>Wireshark shows me the SMB2 NTLMSSP_AUTH packet with what looks like the usual info although I don't know how to decode the security blob. Otherwise it matches the packet from a successful session. In the failure case this packet is followed by an SMB2 response with STATUS_LOGON_FAILURE and a missing security blob. I can only think that the client presents some kind of hash of the password in that security blob and the server is finding that it doesn't match its own password hash - or something like that.</p>
  
  <p>Changing the environment ('Use Active Directory', 'Use Kerberos', etc.) is unfortunately not an option for me here. Also, these are consumer touch-screen kiosks, where no human ever knows the password, and wouldn't have a keyboard to enter it anyway.</p>
  
  <p>ADD: FYI, The changing of the password is done thus:</p>
  
  <pre><code>DirectoryEntry directoryEntry = new DirectoryEntry(string.Format("WinNT://localhost/{0}", username));
  directoryEntry.Invoke("SetPassword", newPassword);
  </code></pre>
  
  <p>ADD: Made that parameter   new object[] {newPassword}, and called .CommitChanges(), because those look like correct things to do. No change in behavior.</p>