ServiceControl 1.7 introduced a new graphical management utility to add, remove, update and delete instances of the ServiceControl service. These actions and some additional tools have also exposed via PowerShell module called
The ServiceControlMgmt module requires:
- Microsoft PowerShell 3.0
The majority of the ServiceControlMgmt PowerShell module cmdlets will only work if the PowerShell session is running under administrator privileges. The ServiceControl installer creates a shortcut in the Windows start menu to launch an administrative PowerShell Session with the module automatically loaded. Alternatively the module can be loaded directly into an an existing PowerShell session by loading
ServiceControlMgmt. using the
Import-Module cmdlet as show below:
Import-Module "C:\Program Files (x86)\Particular Software\ServiceControl Management\ServiceControlMgmt.psd1"
The following general cmdlets and aliases are provided by the ServiceControl Management PowerShell module.
For information about managing ServiceControl instances with PowerShell, see Managing ServiceControl instance via PowerShell.
All of the cmdlets have local help which can be accessed via the standard PowerShell help command
Add the license file to the registry by running the following cmdlet.
The license file is added to the
HKEY_LOCAL_MACHINE registry hive so it available to all instances of ServiceControl installed on the machine.
The ServiceControl Management PowerShell offers some cmdlets to assist with troubleshooting the install of ServiceControl instances.
Before adding an instance of ServiceControl test if the port to use is currently in use.
Test-IfPortIsAvailable -Port 33333
This example shows the available ports out of a range of ports
33330..33339 | Test-IfPortIsAvailable | ? Available
The Window HTTPServer API is used by underlying components in ServiceControl. This API uses a permissions system to limit what accounts can add a HTTP listener to a specific URI. The standard mechanism for viewing and manipulating these ports in via the netsh.exe command line tool.
netsh. will list all of the available. This output is detailed but not very friendly to query. The ServiceControl Management PowerShell provides simplified PowerShell equivalents for listing, add and removing UrlAcls and makes the output easier to query.
For example the following command lists all of the UrlAcls assigned to any URI for port 33333.
Get-UrlAcls | ? Port -eq 33333
In this example any UrlAcl on port 33335 is remove
Get-UrlAcls | ? Port -eq 33335 | Remove-UrlAcl
The following example shows how to add UrlAcl for a ServiceControl service that should only respond to a specific DNS name. This would require an update of the ServiceControl configuration file as well. Refer to setting a custom host name and port number
Add-UrlAcl -Url http://servicecontrol.mycompany.com:33333/api/ -Users Users