2.7 Changing PowerShell Configuration Settings

AppManager for Microsoft SharePoint Server includes the following components:

  • A client object, MCPSHostClient.dll, which runs within the AppManager agent. This client object starts the server program and asks it to run jobs.

  • A server program, MCPSHostServer.exe, which provides the PowerShell environment in which the SharePoint scripts are executed.

Both components have associated configuration files that define certain operational parameters. You can modify these settings to fine-tune performance or to specify resource usage limits.

The configuration files are in XML format. After making changes, ensure that the files retain their well-formed XML format. Also do not remove or change settings other than those documented here. NetIQ Corporation strongly recommends that you create backup copies of these files before modifying them.

NOTE:This topic does not discuss all configuration settings. As a rule, if a configuration setting is not discussed in this topic, you should not change the value of that setting.

2.7.1 Client Configuration Settings

The client configuration file, MCPSHostClient.dll.config, resides in the AppManager\bin\PowerShell directory. You can change the following settings.

In the <appSettings> section:

  • maxActiveServers Use this setting to specify the maximum number of MSPSHostServer.exe instances that can be active at any time. Use this setting in conjunction with maxMemoryUsage to specify a lower memory threshold with an increased number of servers that can be used. This combination is beneficial for situations in which a server exceeds the memory limitation and has to shut down. If only one server can be active at a time, job requests are blocked until the server restarts. If you allow more than one server to be active, job requests can be executed in other server processes or on new servers if the current number of active servers is less than maxActiveServers.

  • serverStartupTimeout Use this setting to specify the number of seconds a job will wait in the client for an opening to become available in a server so that the job can run. A job must wait if maxActiveServers are already running, and if each of those servers is hosting maxActiveClients jobs, otherwise the job will be run in an active server (if an active server exists that is not hosting maxActiveClients), or a new server will be started to host the job.

In the <log4net> section:

  • file Use this setting to specify the pathname of the log file. If the pathname is a relative path, it is considered to be relative to the \AppManager\bin\PowerShell directory.

  • appendToFile Use this setting to indicate whether the client overwrites the existing log file or appends to it, at the time the client is loaded into the AppManager agent.

  • maxSizeRollBackups Use this setting to specify the number of old log files you want to retain.

  • maximumFileSize Use this setting to specify the maximum size of a log file. After a log file reaches this size, it is deleted, or renamed if the maxSizeRollBackups value is greater than 0.

2.7.2 Server Configuration Settings

The server configuration file, MCPSHostServer.exe.config, resides in the AppManager\bin\PowerShell directory. You can change the following settings.

In the <appSettings> section:

  • serverShutdownTimeout Use this setting to specify the number of seconds that the server will remain running while idle, with no jobs executing within it. For example, if you set this option to 1, each MCPSHostServer.exe instance will shut down one second after it enters a state where no jobs are running within it. As long as a single job is running in a server, the server will stay running. When the job count drops to zero, the shutdown timer starts, and when a new job starts running the shutdown timer is turned off and reset.

  • maxActiveClients Use this setting to determine the maximum number of jobs that can run in a single server at the same time. Only jobs that are actively running are taken into account; jobs that are between iterations do not count.

  • maxMemoryUsage Use this setting to specify the maximum amount of memory, in megabytes, that a server will use before it stops accepting new jobs and shuts down. The server will finish executing all jobs currently running on it before the shutdown.

    NOTE:If you raise the values for maxMemoryUsage and maxActiveClients, you can decrease the value for maxActiveServers, because many clients can run in a single server.

In the <log4net> section:

  • file Use this setting to specify the path of the log file. If the path is relative, it is considered to be relative to the \AppManager\bin\PowerShell directory.

  • appendToFile Use this setting to indicate whether the client overwrites the existing log file or appends to it, at the time the client is loaded into the AppManager agent.

  • maxSizeRollBackups Use this setting to specify the number of old log files you want to retain.

  • maximumFileSize Use this setting to specify the maximum size of a log file. After a log file reaches this size, it is deleted, or renamed if the maxSizeRollBackups value is greater than 0.