commands

^

Get-DbaProductKey

Author Chrissy LeMaire (@cl), netnerds.net
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Get-DbaProductKey on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaProductKey.

Synopsis

Gets SQL Server Product Keys from local or destination SQL Servers.

Description

This command find the product key for all installed instances. Clustered instances are supported as well.

Syntax

Get-DbaProductKey
    [-ComputerName] <DbaInstanceParameter[]>
    [[-SqlCredential] <PSCredential>]
    [[-Credential] <PSCredential>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaProductKey -ComputerName winxp, sqlservera, sqlserver2014a, win2k8

Gets SQL Server versions, editions and product keys for all instances within each server or workstation.

Required Parameters

-ComputerName

The target SQL Server instance or instances.

Alias SqlInstance
Required True
Pipeline true (ByValue)
Default Value

Optional Parameters

-SqlCredential

This command logs into the SQL instance to gather additional information. Use this parameter to connect to the discovered SQL instances using alternative credentials. Windows and SQL Authentication supported. Accepts credential objects (Get-Credential)

Alias
Required False
Pipeline false
Default Value
-Credential

Login to the target Windows instance using alternative credentials. Windows Authentication supported. Accepts credential objects (Get-Credential)

Alias
Required False
Pipeline false
Default Value
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False