Sets the Key Management Services (KMS) license configuration.
PowerShell · Risk: High · Documentation Verified
Last verified: 2026-10-26
Microsoft OSLicense reference: Sets the Key Management Services (KMS) license configuration. The syntax and selected example below are adapted from the pinned Windows Server 2025 reference. Module availability, target configuration and delegated permissions determine whether it can run in your environment. Documentation and parameter text: Microsoft, CC BY 4.0; formatting adapted by Cmdlet World. No execution testing is claimed.
Use an account with the target resource permissions documented for Set-KmsLicenseInfo. Modifying administrative cmdlets may require elevation or delegated administration. This catalog does not assert that ordinary users can execute the command.
Supported environments
Windows / OSLicense · Windows Server 2025 documentation; feature/module prerequisites apply
Parameters
-ActivationInterval
Specifies, in minutes, how often unactivated KMS clients try to connect to a KMS host. KMS supports values from 15 through 43200 minutes (30 days), and the default is 120 minutes (two hours). The cmdlet doesn't define a range-validation attribute for this parameter. The licensing service validates the value and returns failure details in the result object when it rejects a value. If you omit this parameter, the current setting remains unchanged.
-AsJob
Runs the command as a background job. The command returns a job object that you can use with the PowerShell job cmdlets. The implicit remoting proxy provides this parameter.
-DnsPublishing
Specifies whether the KMS host publishes its service resource (SRV) record in Domain Name System (DNS). Specify $true to enable publishing or $false to disable it. By default, a KMS host publishes its SRV record in DNS. If you omit this parameter, the current setting remains unchanged.
-Domain
Specifies the DNS domain in which the KMS client searches for KMS SRV records. This setting has no effect when you configure a specific KMS host with ServerName. If you omit this parameter, the current setting remains unchanged.
-HostCaching
Specifies whether a KMS client caches a discovered KMS host. Specify $true to enable caching or $false to disable it. The KMS client enables host caching by default. If you omit this parameter, the current setting remains unchanged.
-ListeningPort
Specifies the TCP port on which a KMS host listens for client activation requests. The KMS default listening port is 1688. The cmdlet doesn't define a range-validation attribute for this parameter; the licensing service validates the value. If you omit this parameter, the current setting remains unchanged.
-Port
Specifies the TCP port that the KMS client uses to contact the KMS host that ServerName specifies. The KMS default port is 1688. The cmdlet doesn't define a range-validation attribute for this parameter; the licensing service validates the value. If you omit this parameter, the current setting remains unchanged.
-Priority
Specifies the process priority for the KMS host. The default is Normal. Use Low with care because other active applications or server roles can prevent a low-priority KMS host from responding in a timely manner. If you omit this parameter, the current setting remains unchanged.
-RenewalInterval
Specifies, in minutes, how often activated KMS clients try to renew their activation. KMS supports values from 15 through 43200 minutes (30 days), and the default is 10080 minutes (seven days). The cmdlet doesn't define a range-validation attribute for this parameter. The licensing service validates the value and returns failure details in the result object when it rejects a value. If you omit this parameter, the current setting remains unchanged.
-ServerName
Specifies the host name of the KMS host that the client contacts. Configuring a specific KMS host disables KMS host autodiscovery. If you omit this parameter, the current setting remains unchanged.
Prerequisites
Windows with the OSLicense module and the Windows feature or management tools that provide it. Confirm target connectivity and version compatibility using the linked Microsoft reference.
Security considerations
This cmdlet changes system state. Review every target and parameter in the official reference, test outside production, and prepare an appropriate backup or rollback. Do not execute the example automatically.
This command configures the local KMS client to contact the fictitious host kms01.example.com on TCP port 1688. Setting a specific host disables KMS host autodiscovery. This command changes the local computer's licensing configuration, so confirm the host name and port before you run it. The command returns an object with a Success property that indicates whether the licensing service applied the configuration. Source: Microsoft, CC BY 4.0; transcript prompt/output removed. This example was not executed.