Setup IIS sites and services using PowerShell scripts
- Last UpdatedMay 08, 2026
- 5 minute read
The SetupServer folder in the AVEVA Enterprise Resource Management installation package contains the Setup-Environment.ps1 PowerShell script and OpenUnrestrictedPowerShell.bat.
Setup-Environment.ps1 sets up an AVEVA Enterprise Resource Management server environment, including the IIS sites for AVEVA Enterprise Resource Management server, API, API-REST & Supplier Portal and Windows Services for Import Service & Multi Consumer Service. Database schema creation is not handled by the script.
By default, all components are set up unless one or more No component Setup parameters are specified.
For IIS sites, the script:
-
Creates the site folder
-
Creates the IIS site
-
Configures bindings and authentication based on the site type (ERM / API / API-REST / Supplier Portal)
The default port configuration is as follows:
-
AVEVA Enterprise Resource Management site
-
net.tcp: 92xx
-
HTTP: 93xx
-
-
AVEVA Enterprise Resource Management-API site
-
HTTP: 95xx
-
-
AVEVA Enterprise Resource Management-API-REST site
-
HTTP: 96xx
-
-
AVEVA Enterprise Resource Management-Supplier Portal site
-
HTTP: 97xx (unless overridden using SupplierPortalHttpPort)
-
HTTPS: 98xx (unless overridden using SupplierPortalHttpsPort)
-
For Windows services, the script:
-
Creates the service folder
-
Registers the service based on the service type (Import or Multi Consumer)
Before the setup of each component, the script checks whether an IIS site or Windows service with the same environment name already exists. If same name exists, the script verifies and corrects selected settings if needed, and then moves on to the next component.
The script can run multiple times using the same environment name. However, running the script again with different parameters for an existing environment does not change previously configured settings.
This script does not install the AVEVA Enterprise Resource Management application binaries, and only prepares the required server environment. To install or upgrade the application, use the Install-Server-Upgrade.ps1 script, see Deploy AVEVA ERM Application Server Components.
The script requires administrator privileges. Alternatively, when running the script on a remote machine, the UserName and Password parameters is required along with the ComputerName.
Parameters
[string]Environment: The name of the environment, for example, Prod or Test. The site or service path and log file path contains the name. Only characters valid for Windows file and directory names are permitted.
[string]RunAsUsername: The account name to run the sites and services is required in the DOMAIN\user format for domain users or the .\user format for local users. The account is required to have read/write access to the RootPath.
[string]RunAsPassword: The password for the user specified in the RunAsUsername parameter.
[string]RootPath: The root path for environment. The default value is C:\AVEVA. The sites and services are set up in subfolders.
[int]PortIndex: The port index (0-99) is used for IIS sites, such as xx in 92xx, 93xx, 95xx, 96xx, 97xx and 98xx, for example, PortIndex 1 creates port 9201. If the parameter is omitted, the next available port index on the localhost or ComputerName is used in the existing 93xx range.
[int]SupplierPortalHttpPort: The port for the HTTP site of the Supplier Portal. Use only if needed to override the default 97xx.
[int]SupplierPortalHttpsPort: The port for the HTTPS site of the Supplier Portal. Use only if needed to override the default 98xx.
[string]CertThumbprint: The thumbprint (fingerprint) of the certificate to use for HTTPS binding that exists in the certificate store LocalMachine\My. The parameter is mandatory for setting up Supplier Portal.
[string]ComputerName: The computer on which to set up the environment, including the AVEVA Enterprise Resource Management server, API, API-REST, Supplier Portal, Import Service, and Multi Consumer Service. The ComputerName, Username and Password parameters are dependent, so either all parameters are given or none of the parameters are given.
[string]Username: The username used in the setup of ComputerName is required in the DOMAIN\user format for domain users or the .\user format for local users and required administrator privileges on ComputerName. The ComputerName, Username and Password parameters are dependent, so either all parameters are given or none of the parameters are given.
[string]Password: The password used in the setup of ComputerName. The ComputerName, Username and Password parameters are dependent, so either all parameters are given or none of the parameters are given.
[switch]NoServerSetup: If available, the IIS site for AVEVA Enterprise Resource Management server is not setup.
[switch]NoApiSetup: If available, the IIS site for API is not setup.
[switch]NoApiRestSetup: If available, the IIS site for API-REST is not setup.
[switch]NoSupplierPortalSetup: If available, the IIS site for Supplier Portal is not setup.
[switch]NoImportServiceSetup: If available, Windows Service for Import Service is not setup.
[switch]NoMultiConsumerServiceSetup: If available, Windows Service for Multi Consumer Service is not setup.
Usage Examples
Example A:
.\Setup-Environment.ps1 -Environment Test -RunAsUsername .\ErmUser -RunAsPassword MyPassword
A common setup for a main server installation without configuring the Supplier Portal. An environment named Test is created on the local machine in C:\AVEVA, that runs all sites and services that use the ErmUser account, and automatically selects the next available port index in IIS. The script is processed with the standard -Verbose option enabled to provide detailed output during setup.
Example B:
.\Setup-Environment.ps1 -Environment Test -RunAsUsername .\ErmUser -RunAsPassword ErmUserPassword -SupplierPortalHttpPort 80 -SupplierPortalHttpsPort 443 -CertThumbprint d48a967cab6f732471a79549acdab0e11f52e562 -NoServerSetup -NoApiSetup -NoApiRestSetup -NoImportServiceSetup -NoMultiConsumerServiceSetup –Verbose
A dedicated Supplier Portal server is configured. Only the Supplier Portal component is set up for the Test environment; all other server components are excluded.
The environment is created on the local machine in C:\AVEVA, with the Supplier Portal configured to use port 80 for HTTP and port 443 for HTTPS. The HTTPS binding uses the certificate identified by the specified certificate thumbprint. The script runs with the -Verbose option enabled to provide detailed output.
Example C:
.\Setup-Environment.ps1 -Environment Test -RunAsUsername .\ErmUser -RunAsPassword ErmUserPassword -RootPath D:\AVEVA -PortIndex 1 -ComputerName MyServer -Username .\MyAdminUser -Password MyAdminPassword -CertThumbprint d48a967cab6f732471a79549acdab0e11f52e562 -Verbose
An advanced setup scenario in which a complete AVEVA Enterprise Resource Management environment named Test is configured on a remote server (MyServer).
The environment is created under the root path D:\AVEVA and runs using the ErmUser account. Administrative access to the remote server is provided through the MyAdminUser account. The configuration uses port index 1, resulting in the following port assignments:
-
9201 (net.tcp)
-
9301 (HTTP)
-
9501 (API)
-
9601 (API-REST)
-
9701 (Supplier Portal HTTP)
-
9801 (Supplier Portal HTTPS)
The script is run with the -Verbose option is made available to provide detailed output during setup.