Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to configure SQL Server 2012 Core for connections from a remote machine


How to configure SQL Server 2012 Core for connections from a remote machine

Author
Message
shew
shew
SSC-Addicted
SSC-Addicted (418 reputation)SSC-Addicted (418 reputation)SSC-Addicted (418 reputation)SSC-Addicted (418 reputation)SSC-Addicted (418 reputation)SSC-Addicted (418 reputation)SSC-Addicted (418 reputation)SSC-Addicted (418 reputation)

Group: General Forum Members
Points: 418 Visits: 929
Can anyone tell me how to configure SQL Server 2012 Core for connections from a remote machine?

Local connections using sqlcmd.exe on the Core machine work fine using: sqlcmd.exe -S MYSERVERNAME\MYINSTANCENAME -E -Q "select @@version"

-------------------------------------------------------------------------------------------------------------

Microsoft SQL Server 2012 (SP1) - 11.0.3000.0 (X64)
Oct 19 2012 13:38:57
Copyright (c) Microsoft Corporation
Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)


(1 rows affected)



Based on a link I found, I enabled TCP/IP on the Core machine with the following code:

    $smo = 'Microsoft.SqlServer.Management.Smo.'
$wmi = new-object ($smo + 'Wmi.ManagedComputer')

# Enable the TCP protocol on the default instance. If the instance is named, replace MSSQLSERVER with the instance name in the following line.
$uri = "ManagedComputer[@Name='" + (get-item env:\computername).Value + "']/ServerInstance[@Name='MYINSTANCENAME']/ServerProtocol[@Name='Tcp']"

$Tcp = $wmi.GetSmoObject($uri)
$Tcp.IsEnabled = $true
$Tcp.Alter()
$Tcp


I presume that this code is hanging for some reason because the output "State" is always set to "Creating." (Please see the last line in this output.)

Parent              : Microsoft.SqlServer.Management.Smo.Wmi.ServerInstance
DisplayName : TCP/IP
HasMultiIPAddresses : True
IsEnabled : True
IPAddresses : {IP1, IP2, IP3, IP4...}
ProtocolProperties : {Enabled, KeepAlive, ListenOnAllIPs}
Urn : ManagedComputer[@Name='MYSERVERNAME']/ServerInstance[@Name='MYINSTANCENAME']/ServerProtocol[@Name='Tcp']
Name : Tcp
Properties : {Name=DisplayName/Type=System.String/Writable=False/Value=TCP/IP, Name=HasMultiIPAddresses/Type=System.Boolean/Writable=False/Value=True, Name=IsEnabled/Type=System.Boolean/Writable=True/Value=True}
UserData :
State : Creating


Output from SQLDiag on the Core machine indicates that SQL Server is Listening on dynamic port 49189.

Here is the output from netstat -ano| findstr 49189:

  TCP    127.0.0.1:49189        0.0.0.0:0              LISTENING       1308
TCP [::1]:49189 [::]:0 LISTENING 1308


I think the problem is that the remote machine is trying to connect on port 1433 (which is what I want so that I can emulate my work environment), but the Core machine is listing on dynamic port 49189.

How can I change the Core machine, which does not have the SQL Server Configuration Manager installed, to listen on static port 1433?



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search