SmarterMail Pro™ Administration Web Services

svcUserAdmin.AddUser Method 

Creates a new user and adds them to the specified domain.

public GenericResult AddUser(
   string AuthUserName,
   string AuthPassword,
   string NewUsername,
   string NewPassword,
   string DomainName,
   string FirstName,
   string LastName,
   bool IsDomainAdmin
);

Parameters

AuthUserName
User name with domain administrative privileges
AuthPassword
Password for AuthUserName
NewUsername
Name of the new account to create
NewPassword
Password for NewUsername
DomainName
Domain in which account is being created
FirstName
Account user's first name
LastName
Account user's last name
IsDomainAdmin
Defines whether the user account has administrative privileges

Return Value

A GenericResult instance containing the results of the AddUser action.

Example

The following sample creates a new user account in the domain.net domain.

using System;
using svcUserAdmin;

class svcUserAdminCreateUser
{
 static void Main()
 {
   svcUserAdmin admin = new svcUserAdmin();
   GenericResult status = admin.AddUser("admin@domain.net",
                                        "alskdjfhtt",
                                        "dlindt",
                                        "qpoiwu",
                                        "domain.net",
                                        "Dexter",
                                        "Lindt",
                                        false);

   if(status.Result)
     Console.WriteLine ("User added");
   else
     Console.WriteLine (status.Message);
  }
}

See Also

svcUserAdmin Class | svcUserAdmin Namespace