dbatools is a free PowerShell module with over 300 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Test-DbaCmConnection

Tests over which paths a computer can be managed.

This function tries out the connectivity for:
– Cim over WinRM
– Cim over DCOM
– Wmi
– PowerShellRemoting
Results will be written to the connectivity cache and will cause Get-DbaCmObject and Invoke-DbaCmMethod to connect using the way most likely to succeed. This way, it is likely the other commands will take less time to execute. These other’s too cache their results, in order to dynamically update connection statistics.

This function ignores global configuration settings limiting which protocols may be used.

Screenshots

dbatools-Test-DbaCmConnection

Examples

Performs a full-spectrum connection test against the computer sql2014. The results will be reported and registered, future calls from Get-DbaCmObject will thus recognize the results and optimize the query.

Test-DbaCmConnection -ComputerName sql2014

This test will run a connectivity test against the computer sql2014
– It will use windows authentication of the current user
– It will only test Cim over DCOM and Cim over WinRM

The results will be reported and registered, future calls from Get-DbaCObject will thus recognize the results and optimize the query.

Test-DbaCmConnection -ComputerName sql2014 -Credential $null -Type CimDCOM, CimRM

Author

This command was created by Friedrich Weinmann. You can find Fred on blogging at allthingspowershell.blogspot.de and Tweeting at @FredWeinmann

Get-Help

From PowerShell, execute Get-Help Test-DbaCmConnection -Detailed for more information on this function.

Source Code

Want to see the source code? View Test-DbaCmConnection.ps1 on GitHub
 

Related commands