INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

SQL SERVER 2016 - Properties TCP / IP - Open IPALL TCPPort 1433

SQL SERVER 2016 - Properties TCP / IP - Open IPALL TCPPort 1433

(OP)


An issue that is driving me crazy for a week

I need to open 1433 without outside help from users

For this I have tried the following 1º Access the registry key and modify it from vb.net, Framework 4.0 Visual Studio 2010, but the key does not allow to modify it HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13.MSSQLSERVERMSSQLServer\SuperSocketNetLib\Tcp\IPAll

2nd Launch a .bat that launches a vb.script Contents of .bat @echo off if %1==payload goto :payload

:getadmin echo %~nx0: elevating self set vbs=%temp%\getadmin.vbs echo Set UAC = CreateObject^(“Shell.Application”^) >> "%vbs%“ echo UAC.ShellExecute “%~s0”, “payload %~sdp0 %*”, “”, “runas”, 1 >> “%vbs%” ”%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" goto :eof

:payload

::ENTER YOUR CODE BELOW::

cd
cd C:\Program Files (x86)\MiCarpeta dir pause

start 1433_SQL2016.vbs

pause

::END OF YOUR CODE::

echo. echo…Script Complete… echo.

pause

Contents of a vbscript gist.github.com https://gist.github.com/stefanteixeira/12602d32416...

configIPAll.vbs

set wmiComputer = GetObject( _ "winmgmts:" _ & "\.\root\Microsoft\SqlServer\ComputerManagement12") set tcpProperties = wmiComputer.ExecQuery( _ "select * from ServerNetworkProtocolProperty " _ & "where InstanceName='MSSQLSERVER' and " _ & "ProtocolName='Tcp' and IPAddressName='IPAll'")

for each tcpProperty in tcpProperties dim setValueResult, requestedValue This file has been truncated. show original set wmiComputer = GetObject( _ “winmgmts:” _ & “!.\root\Microsoft\SqlServer\ComputerManagement13”)

set tcpProperties = wmiComputer.ExecQuery( _ "select * from ServerNetworkProtocolProperty " _ & "where InstanceName='MSSQLSERVER' and " _ & "ProtocolName='Tcp' and IPAddressName='IPAll'")

for each tcpProperty in tcpProperties

dim setValueResult, requestedValue
Wscript.Echo tcpProperty.PropertyName
if tcpProperty.PropertyName = "TcpPort" then
requestedValue = "1433"
elseif tcpProperty.PropertyName ="TcpDynamicPorts" then
requestedValue = ""
end if
setValueResult = tcpProperty.SetStringValue(requestedValue)
if setValueResult = 0 then
Wscript.Echo "" & tcpProperty.PropertyName & " set."
else
Wscript.Echo "" & tcpProperty.PropertyName & " failed!"
end if
next If I launch this .bat from a double click with mouse help, it executes and changes the port to 1433 However, if the .bat is thrown from a process.start + admin permissions “runas” does not find image




3rd

I have also tried with the query to try changing the registry key of windows but nothing DECLARE @portNumber NVARCHAR(10)=1433

EXEC xp_instance_regread @rootkey = ‘HKEY_LOCAL_MACHINE’, @key = ‘SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQLServer\SuperSocketNetLib\Tcp\IPAll’, @value_name = ‘TcpPort’, @value = @portNumber OUTPUT

SELECT [Port Number] = @portNumber GO

Someone in myself situation ??? Thank you

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close