Creating and editing a user

The following code shows assignment of properties for a new user:

define variable user as IUser no-undo.
assign
  user = service:NewUser("mcblack")
  user:Password = /* application variable */
  user:GivenName = "Martin"
  user:SurName  = "Black"
  user:Domain = service:GetDomain("AcmeDomain").

service:CreateUser(user).

After the user has been created the password can only be changed by the actual user.