Adding a Site

This method creates a new site from an existing template on the Parallels Pro Control Panel server.

Method

public void AddSite (Site site, string username, string password)

Parameters

  • site, which is the Site object with details of the new site to be added
  • username, which is the username of the service provider/Reseller
  • password, which is the password of the service provider/Reseller

Return Value

none

Note: Before running this method, the Parallels Pro Control Panel must contain a template for adding a new site. If a template does not exist, you must create a new template using the Parallels Pro Control Panel. For instructions on creating a new template, please refer to the online Help available in the Parallels Pro Control Panel by clicking General Help in the Help section on the left navigation panel.

Example Code:

Site site = new Site();

site.DisplayName = "mysite.com";

site.Name = "mysite.com";

site.ShortName = "mysite.com";

site.TemplateName = "Default Template";

site.ContactEmail = "blackhole@ensim.com";

site.AdminUserName = "admin";

site.AdminDisplayName = "Administrator";

site.AdminPassword = "ensim123";

site.AdminEmail = "user@example1.com";

site.IpBased = true; //Set false for name based sites

site.IpSelection = "auto";

//Specify IP address(10.76.32.95) or auto for automatic allocation.

//(This is applicable only for IP-based sites)

w.AddSite(site, "admin", "ensim123");