Configures a connection object for use in remote computer management. This function will either create new records for computers that have no connection registered so far, or it will configure existing connections if already present.
As such it can be handy in making bulk-edits on connections or manually adjusting some settings.
Retrieves the already existing connection to sql2014, removes the list of not working credentials and configures it to default to the credentials of the logged on user.
Get-DbaCmConnection sql2014 | Set-DbaCmConnection -ClearBadCredential -UseWindowsCredentials
Removes the credentials stored in $cred from all connections’ list of “known to not work” credentials. Handy to update changes in privilege.
Get-DbaCmConnection | Set-DbaCmConnection -RemoveBadCredential $cred
At first, the current cached connections are stored in an xml file. At a later time – possibly in the profile when starting the console again – those connections are imported again and applied again to the connection cache.
In this example, the configuration settings will also be reset, since after reimport those will be set to explicit, rather than deriving them from the global settings.
In many cases, using the default settings is desirable. For specific settings, use New-DbaCmConnection as part of the profile in order to explicitly configure a connection.
Get-DbaCmConnection | Export-Clixml .\connections.xml
Import-Clixml .\connections.xml | Set-DbaCmConnection -ResetConfiguration