dbatools is a free PowerShell module with over 200 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


Tests the ability to connect to an SQL Server instance outputting information about the server and instance.




ComputerName : SQL2016
InstanceName : MSSQLSERVER
SqlInstance : sql2016
SqlVersion : 13.0.4001
ConnectingAsUser : BASE\ctrlb
ConnectSuccess : True
AuthType : Windows Authentication
AuthScheme : KERBEROS
TcpPort : 1433
IPAddress :
NetBiosName : sql2016.base.local
IsPingable : True
PSRemotingAccessible : True
DomainName : base.local
LocalWindows : 10.0.15063.0
LocalPowerShell : 5.1.15063.502
LocalCLR : 4.0.30319.42000
LocalSMOVersion :
LocalDomainUser : True
LocalRunAsAdmin : False

Test-DbaConnection SQL2016


This command was created by Chrissy LeMaire. You can find Chrissy on Twitter.


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

Source Code

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

Related commands