| title | Enable or Disable a Server Network Protocol | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| description | Use SQL Server Configuration Manager or PowerShell to enable or disable a SQL Server server network protocol. | |||||||||
| author | rwestMSFT | |||||||||
| ms.author | randolphwest | |||||||||
| ms.date | 08/26/2025 | |||||||||
| ms.service | sql | |||||||||
| ms.subservice | configuration | |||||||||
| ms.topic | how-to | |||||||||
| helpviewer_keywords |
|
[!INCLUDE sql-windows-only]
All network protocols are installed during installation, by [!INCLUDE ssNoVersion] Setup, but might or might not be enabled. This article describes how to enable or disable a server network protocol in [!INCLUDE ssnoversion] by using [!INCLUDE ssNoVersion] Configuration Manager or PowerShell. The [!INCLUDE ssDE] must be stopped and restarted for the change to take effect.
-
During setup of [!INCLUDE ssExpress] edition, a login is added for the BUILTIN\Users group. This login allows all authenticated users of the computer to access the instance of [!INCLUDE ssExpress] as a member of the public role. The BUILTIN\Users login can be safely removed to restrict [!INCLUDE ssDE] access to computer users who have individual logins or are members of other Windows groups with logins.
-
[!INCLUDE ssNoVersion] and [!INCLUDE msCoName] data providers for [!INCLUDE ssNoVersion] up to [!INCLUDE sssql14] only support TLS 1.0 and SSL 3.0 by default. If you enforce a different protocol (such as TLS 1.1 or TLS 1.2) by making changes in the operating system SChannel layer, your connections to [!INCLUDE ssNoVersion] might fail, unless you install the appropriate update to add support for TLS 1.1 and 1.2 to [!INCLUDE ssNoVersion]. For more information, see TLS 1.2 support for Microsoft SQL Server. In [!INCLUDE sssql16-md] and later versions, all release versions of SQL Server include at least TLS 1.2 support without further updates required.
-
In [!INCLUDE ssNoVersion] Configuration Manager, in the console pane, expand SQL Server Network Configuration.
-
In the console pane, select Protocols for <instance name>.
-
In the details pane, right-click the protocol you want to change, and then select Enable or Disable.
-
In the console pane, select SQL Server Services.
-
In the details pane, right-click SQL Server (<instance name>), and then select Restart, to stop and restart the [!INCLUDE ssNoVersion] service.
Note
If you have a named instance of [!INCLUDE ssnoversion-md], including [!INCLUDE ssexpress-md] edition, you should also restart the SQL Server Browser service.
-
Using administrator permissions, open a command prompt.
-
Start Windows PowerShell from the taskbar or Start menu.
-
Import the SqlServer module by entering
Import-Module SqlServer. -
Execute the following statements to enable both the TCP and named pipes protocols. Replace
<computer_name>with the name of the computer that is running [!INCLUDE ssNoVersion]. If you're configuring a named instance (including [!INCLUDE ssexpress-md] edition), replaceMSSQLSERVERwith the instance name.To disable protocols, set the
IsEnabledproperties to$false.You can run this script from any machine, with or without SQL Server installed. Make sure you have the SqlServer module installed.
# This script requires the SqlServer module Import-Module SQLServer $wmi = New-Object Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer <#computer_name#> # List the object properties, including the instance names. $Wmi # Enable the TCP protocol on the default instance. $uri = "ManagedComputer[@Name='<#computer_name#>']/ServerInstance[@Name='MSSQLSERVER']/ServerProtocol[@Name='Tcp']" $Tcp = $wmi.GetSmoObject($uri) $Tcp.IsEnabled = $true $Tcp.Alter() $Tcp # Enable the named pipes protocol for the default instance. $uri = "ManagedComputer[@Name='<#computer_name#>']/ServerInstance[@Name='MSSQLSERVER']/ServerProtocol[@Name='Np']" $Np = $wmi.GetSmoObject($uri) $Np.IsEnabled = $true $Np.Alter() $Np
When the script is run locally and configures the local computer, [!INCLUDE ssNoVersion] PowerShell can make the script more flexible by dynamically determining the local computer name. To retrieve the local computer name, replace the line setting the $uri variable with the following line.
$uri = "ManagedComputer[@Name='" + (get-item env:\computername).Value + "']/ServerInstance[@Name='MSSQLSERVER']/ServerProtocol[@Name='Tcp']"After you enable or disable protocols, you must stop and restart the [!INCLUDE ssDE] for the change to take effect. Execute the following statements to stop and start the default instance by using [!INCLUDE ssNoVersion] PowerShell. To stop and start a named instance, replace 'MSSQLSERVER' with 'MSSQL$<instance_name>'.
# Get a reference to the ManagedComputer class.
Set-Location SQLSERVER:\SQL\<computer_name>
$Wmi = (get-item .).ManagedComputer
# Get a reference to the default instance of the Database Engine.
$DfltInstance = $Wmi.Services['MSSQLSERVER']
# Display the state of the service.
$DfltInstance
# Stop the service.
$DfltInstance.Stop();
# Wait until the service has time to stop.
# Refresh the cache.
$DfltInstance.Refresh();
# Display the state of the service.
$DfltInstance
# Start the service again.
$DfltInstance.Start();
# Wait until the service has time to start.
# Refresh the cache and display the state of the service.
$DfltInstance.Refresh();
$DfltInstanceIf you have a named instance of [!INCLUDE ssnoversion-md], including [!INCLUDE ssexpress-md] edition, you should also restart the SQL Server Browser service.