commands

^

Get-DbaCmConnection

Author Friedrich Weinmann (@FredWeinmann)
Availability Windows, Linux, macOS

 

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

Synopsis

Retrieves windows management connections from the cache

Description

Retrieves windows management connections from the cache

Syntax

Get-DbaCmConnection
    [[-ComputerName] <String[]>]
    [[-UserName] <String>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaCmConnection

List all cached connections.

Example: 2
PS C:\> Get-DbaCmConnection sql2014

List the cached connection - if any - to the server sql2014.

Example: 3
PS C:\> Get-DbaCmConnection -UserName "*charles*"

List all cached connection that use a username containing "charles" as default or override credentials.

Optional Parameters

-ComputerName

The computername to ComputerName for.

Alias Filter
Required False
Pipeline true (ByValue)
Default Value *
-UserName

Username on credentials to look for. Will not find connections using the default windows credentials.

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