Closed NowinskiK closed 5 years ago
Hey Kamil, glad you are checking out my code.
Actually, ping is just the name of the function. It is not actually using ping under the hood, but attempting to connect to the SqlServer instance using the SMO library.
Take a look at Ping-SqlServer to see what it is doing.
So there must be a problem with your server access if Ping-SqlServer fail - which is what I am testing for.
As 1433 is the default port, no need to specify in your server name passed to the module.
Best regards,
John
I have access to target server:
test-netconnection server -port 1433
but can't do a PING. In that scenario I'm getting the following error:due to the following line of code:
if (!(Ping-SqlServer -Server $Server)) { throw "Server '$Server' does not exist!";
I'm not sure if testing for the existence of server via PING is the best idea. Could you make this block optional?