﻿# Licensing ServiceControl

<!-- Version variant: servicecontrol_4; default: [/servicecontrol/license.md](/servicecontrol/license.md) -->

## Behavior

The license is read at startup, and every 8 hours thereafter to detect license updates.

### Expired license

If the license has expired (or is corrupted), existing ServiceControl instances will continue to function and can be started and stopped normally. Functionality in ServicePulse will be limited to functionality that supports license renewal.

## License management

In general, ServiceControl instances support [all of the license management options that NServiceBus supports](/nservicebus/licensing/index.md#license-management), except for code-first configuration and the Windows Registry.

> [!NOTE]
> When using the [user specific license location](/nservicebus/licensing/index.md#license-management-user-specific-license-location) ensure that the account under which the ServiceControl instance is running has permissions to access the user folder.

In addition, ServiceControl provides additional license management techniques:

### ServiceControl Management Utility (SCMU)

ServiceControl has a license user interface accessible in ServiceControl Management, which is a Windows only management utility.


ServiceControl Management is installed together with ServiceControl and can be found in the Windows Start Menu.


The selected license file will be stored in the [machine-wide license file location](/nservicebus/licensing/index.md#license-management-machine-wide-license-location), so it is available to all instances of ServiceControl regardless of the service account used.

![Add License](managementutil-addlicense.png 'width=500')

### ServiceControl PowerShell

To import a license using PowerShell:

 * Start PowerShell
 * Ensure [ServiceControl PowerShell Module](https://www.powershellgallery.com/packages/Particular.ServiceControl.Management) is installed.
 * Execute the following cmdlet with the path to the license file.

<!-- snippet: ps-importlicense -->

```ps1
Import-ServiceControlLicense License.xml
```

<!-- endsnippet -->

### License from file system

It is also possible to load the license from any location in the file system by configuring the `NServiceBus/LicensePath` setting. This allows the license to be loaded from, for example, a central network share instead of the registry.

> [!NOTE]
The easiest way to find the configuration file, on Windows, is to launch the Service Control Management Utility (SCMU), navigate to the relevant instance, and open its deployment paths.

<!-- snippet: config-licensepath -->

```xml
<add key="NServiceBus/LicensePath" value="d:\NServiceBus\License\License.xml" />
```

<!-- endsnippet -->

> [!NOTE]
> This is the same setting to configure a license path for an NServiceBus 7 or lower endpoint. This license configuration option is [no longer supported in NServiceBus 8](/nservicebus/upgrades/7to8/index.md#change-to-license-file-locations) or later endpoints.
