Updating User Information

This method updates an existing user's information.

Method

public void UpdateUser (UserForUpdate user, string username, string password)

Parameters

  • user, which is the UserForUpdate object with details for the user to be updated
  • username, which is the username of the site administrator
  • password, which is the password of the site administrator

Return Value

none

Example Code:

UserForUpdate user = new UserForUpdate();

user.Username = "user1@mysite.com"; //username cannot be changed

user.Enabled = true;

user.Admin = false;

user.City = "Sunnyvale";

user.Company = "Parallels Pro Control Panel";

user.Country = "US";

user.Department = "Engg.";

user.Description = "WS Test User";

user.Email = "blackhole@ensim.com";

user.FirstName = "WebServices";

user.LastName = "Test User";

user.MiddleName = "";

user.Office = "Office";

user.Phone = "0123465789";

user.State = "CA";

user.Street = "Office Lane";

//user service components

user.mail = null; //To remove service component set to null

user.msftpsvc = null; //To remove service component set to null

user.w3svc = new User_W3SVC();

user.frontpage = new User_FRONTPAGE();

user.frontpage.ContentUploader = true; //Allow user access to site's website

w.UpdateUser(user, "admin@mysite.com", "ensim123");

Note: While updating the user information, the user name cannot be changed.