PowerShell: Get computer name from SQL Instance name.

Split a SQL Instance name to get the server name.

$Computer = $SQLInstance.Split('\')[0]

# or

$ServersList | %{
	$_.Split('\')[0]
}

Comments are closed.

Post Navigation