title: create local user account
body: <p>i have this code to create a local windows user</p>
  
  <pre><code>public static bool CreateLocalWindowsAccount(string username, string password, string displayName, string description, bool canChangePwd, bool pwdExpires)
      {
  
          try
          {
              PrincipalContext context = new PrincipalContext(ContextType.Machine);
              UserPrincipal user = new UserPrincipal(context);
              user.SetPassword(password);
              user.DisplayName = displayName;
              user.Name = username;
              user.Description = description;
              user.UserCannotChangePassword = canChangePwd;
              user.PasswordNeverExpires = pwdExpires;
              user.Save();
  
  
              //now add user to "Users" group so it displays in Control Panel
              GroupPrincipal group = GroupPrincipal.FindByIdentity(context, "Users");
              group.Members.Add(user);
              group.Save();
  
              return true;
          }
          catch (Exception ex)
          {
              LogMessageToFile("error msg" + ex.Message);
              return false;
          }
  
      }
  </code></pre>
  
  <p>i tried this on my machine it works fine. but then i put this on windows server. and tried to create a user over there.</p>
  
  <p>First i got the error "General access denied error"
  so i made the user an administrator</p>
  
  <p>but now i get the error "The network path was not found"</p>
  
  <p>how can i solve this error.. thanks</p>