title: RPC server is unavailable 0x800706BA, while updating password for user in active directory
body: <p>I am using System.DirectoryServices.AccountManagement apis to create a new user/disable an account in Active Directory. When i am trying to create a new user, and set its password, m/c throws an exception with the message <strong>The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)</strong>. The following snippet is used to create and persist the user.</p>
  
  <pre><code>UserPrincipal user = new UserPrincipal(ctx);
  user.GivenName = "Andrew";
  user.Surname = "Green";
  user.EmailAddress = "agreeen@gmail.com";
  user.SamAccountName = "agreen";
  user.Save();
  user.SetPassword("Pqw^&amp;12");
  user.Save();
  </code></pre>
  
  <p>When i execute this, the code throws an exception as soon as it tries to set a password.
  After a little search on the net, I tried out the following things.</p>
  
  <ul>
  <li>Since acct <em>agreen</em> gets created without password, there is no privilege or connection issue.</li>
  <li>I added <em>Windows Management Instrumentation(WMI)</em> as exception to the windows firewall on my AD machine</li>
  <li>I ensured that the following services <em>RPC Endpoint Mapper, Remote Procedure Call, Remote Registry</em> are running on the AD machine.</li>
  <li>Ensured that the account, that is used to connect to AD machine, has <em>Enable remote Control</em> checked</li>
  <li>I verified that port 135 is not blocked on AD machine</li>
  </ul>
  
  <p>The setup that i have is, I have box <em>b1</em> running Microsoft Windows 7 Professional, which is trying to connect to a box <em>b2</em>, running Microsoft Windows Server 2008 R2 enterprise. The c# code is running on .Net4.5 framework on b1, and trying to create account on b2.</p>
  
  <p>When i tried running the code from the same box(i.e. box with AD), I was able to successfully create the account with password, when i specified the ip address as localhost, but when i specified it as m/c ip address, it failed with the same exception</p>
  
  <p>Please let me know what i am doing wrong. </p>
  
  <p>Thanks </p>
  
  <p>Vishva</p>