How to Check SQL Server Connectivity from SharePoint?
How do I quickly check SQL Server connectivity from SharePoint server? Well, you can use Telnet.
If your SQL Server listens on different port, change the default port 1433 accordingly.
Using PowerShell to test SQL server connectivity:
Or you can use PowerShell to check if SharePoint it able to connect with SQL Server:
Check SQL Server Connectivity by establishing a connection:
Run this PowerShell script to test whether you are able to connect with SQL Server.
telnet {SQL-Server-Name or IP} 1433
If your SQL Server listens on different port, change the default port 1433 accordingly.
Using PowerShell to test SQL server connectivity:
Or you can use PowerShell to check if SharePoint it able to connect with SQL Server:
(New-Object System.Net.Sockets.TCPClient("SQL-Server-Name",1433)).ConnectedThis tells you whether the particular PORT is open on the given server.
Check SQL Server Connectivity by establishing a connection:
Run this PowerShell script to test whether you are able to connect with SQL Server.
Function Check-SQLServerConnection([string]$serverInstance) { $connectionString = "Data Source={0};Integrated Security=true;Application Name=CheckSQLServer" -f $serverInstance; $sqlConn = new-object("Data.SqlClient.SQLConnection") $connectionString; Write-Host $connectionString try { $sqlConn.Open(); $sqlConn.Close(); Write-Host "Connected OK"-foregroundcolor white -backgroundcolor green } catch { Write-Host $_ -foregroundcolor white -backgroundcolor red } finally { $sqlConn.Dispose(); } } #Call the function with your SQL Server Machine Name Check-SQLServerConnection "SP13-SQL01"
No comments:
Please Login and comment to get your questions answered!