< Back

Get-DbaCmConnection

Mon Jan 13, 2020 10:26 am

NAME Get-DbaCmConnection



SYNOPSIS

Retrieves windows management connections from the cache





SYNTAX

Get-DbaCmConnection [[-ComputerName] <System.String[]>] [[-UserName] <String>] [-EnableException <Switch>]

[<CommonParameters>]





DESCRIPTION

Retrieves windows management connections from the cache





PARAMETERS

-ComputerName [<System.String[]>]

The computername to ComputerName for.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-EnableException [<Switch>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-UserName [<String>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: ComputerManagement, CIM

Author: Friedrich Weinmann (@FredWeinmann)



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- 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.



RELATED LINKS

https://dbatools.io/Get-DbaCmConnection