Zolf
asked on
Enabling TCP/IP/ protocol in sql server configuration manager using CMD
Hello there,,
How can I ENABLE TCP/IP protocol in sql server configuration manager using COMMAND PROMPT ?. I am using SQL server 2008.
cheers
Zolf
How can I ENABLE TCP/IP protocol in sql server configuration manager using COMMAND PROMPT ?. I am using SQL server 2008.
cheers
Zolf
ASKER
this is not working for me. i get below error.....cannot i use simple cmd.
I tried something like this in my cmd prompt. But it is not enabling the TCP when i check in sql server configuration manager
PS C:\Users\zaj> Import-Module "sqlps"
Import-Module : The specified module 'sqlps' was not loaded because no valid module file was found in any module direct
ory.
At line:1 char:14
+ Import-Module <<<< "sqlps"
+ CategoryInfo : ResourceUnavailable: (sqlps:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.Pow erShell.Co mmands.Imp ortModuleC ommand
I tried something like this in my cmd prompt. But it is not enabling the TCP when i check in sql server configuration manager
C:\Users\zaj>WMIC /NAMESPACE:\\root\Microsoft\SqlServer\ComputerManagement10 PATH ClientNetwork
Protocol WHERE ProtocolName='Tcp' CALL SetEnable
Executing (\\ZAJ-VAIO\root\Microsoft\SqlServer\ComputerManagement10:ClientNetworkProtocol.Proto
colName="tcp")->SetEnable()
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
ReturnValue = 0;
};
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for your help...but i get this error. I am copying the script as mentioned in that link
C:\>WMIC /NAMESPACE:\\root\Microsoft\SqlServer\ComputerManagement10 PATH ServerNetworkProtocol
Where ProtocolName='Tcp' CALL SetEnable
ERROR:
Description = Invalid query
ASKER
it seems it is those quotes surrounding TCP which waS GIVING THAT ERROR. By the way something is going on here and that is I disable my tcp from the sql server configuration manager and then using the cmd i am testing to see if it enables it but it seems it is not enabling. what is wrong or what am i missing or doing wrong.
The query works fine perfectly fine on my system, may be it's a error on your sql server. Do you installed Sql Server on your system or just client.
ASKER
i have installed server 2008..weird!! via sql server configuration manager it works but not via cmd script
it's a default instance or named instance.
if it is a named instance then use it like this:
WMIC /NAMESPACE:\\root\Microsof t\SqlServe r\Computer Management 10\instanc e_name
if it is a named instance then use it like this:
WMIC /NAMESPACE:\\root\Microsof
ASKER
no its default instance
Remove 10 after ComputerManagement10 from this and then give a try.
ASKER
i get this error when i remove that 10
C:\>WMIC /NAMESPACE:\\root\Microsof t\SqlServe r\Computer Management PATH ServerNetworkProtocol Wh
ere ProtocolName='Tcp' CALL SetEnable
ERROR:
Description = Invalid namespace
C:\>WMIC /NAMESPACE:\\root\Microsof
ere ProtocolName='Tcp' CALL SetEnable
ERROR:
Description = Invalid namespace
After you run this script in command prompt, just do a refresh on SQL Server Configuration manager.
or Close SQL Server configuration manager and then open it.
because it does not refresh by itself.
or Close SQL Server configuration manager and then open it.
because it does not refresh by itself.
ASKER
the same issue i have with enable. that is i disable the tcp/ip from the configuration manager and then via the cmd i run the script to enable, it runs the script but when i check the manager it is not disabled
ASKER
After you run this script in command prompt, just do a refresh on SQL Server Configuration manager.
I tried to refresh and also close and start the mssql instance but no luck
i do not know what happening on your end but as seen in your screenshot query works fine.
i am working on same query and works perfectly fine with me.
i am working on same query and works perfectly fine with me.
ASKER
yes the query is running but it is not applying those changes to the sql server. could it be that this script is doing this action on another sql server...as far as i know i just have one sql server instace which is called MSSQLSERVER
ASKER
can we explicitly tell the script to get this instance of mssql and apply the changes...to be sure
this script is doing changes on default instance by default that is MSSQLSERVER
ASKER
i dont know why it is not working for me via the CMD script method
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK, using this script also it i snot working.do you get the same output when you run the ServerNetworkProtocol. the reason is when i run the client i get the script output different compared to the server version.as you can see below the output when i run using the ServerNetworkProtocol
C:\>WMIC /NAMESPACE:\\root\Microsoft\SqlServer\ComputerManagement10 PATH ServerNetworkProtocol
Where ProtocolName='Tcp' CALL SetDisable
Executing (\\ZAJ-VAIO\root\Microsoft\SqlServer\ComputerManagement10:ServerNetworkProtocol.Insta
nceName="MSSQLSERVER",ProtocolName="Tcp")->SetDisable()
Method execution successful.
yes i got same result on execution, and my services are disabled and enabled by this script.
ASKER
dont know what I am missing...frustrating...an yway thanks for your help!!
ASKER
i will wait for a day if i dont get any solution i will except your answer
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I did that,but still the changes are not reflected.weird
you can do it by powershell.
try this link http://msdn.microsoft.com/en-us/library/ms191294.aspx