Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
497 views
in Technique[技术] by (71.8m points)

powershell - Enable SQL Server express to listen with TCP/IP

I am trying to enable my sql server express to listen with TCP/IP.

The issue I am having is that when I run the below command on my local dev machine and then on the UAT server, I get different results.

# Enable TCP/IP
$smo = 'Microsoft.SqlServer.Management.Smo.'  
$wmi = new-object ($smo + 'Wmi.ManagedComputer')

# List the object properties, including the instance names.  
$Wmi

Here are my results:

Dev -

enter image description here

UAT Server -

enter image description here

I can't enable TCP/IP for the SQL server on UAT because the WMI object does not contain the instance of SQL Server running on it?

Does anyone have an idea why this?

question from:https://stackoverflow.com/questions/65833658/enable-sql-server-express-to-listen-with-tcp-ip

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Turns out the WMI provider was corrupt and had to be recompiled.

Here are a couple of solutions, Option 1 did the trick for me.

https://docs.microsoft.com/en-us/troubleshoot/sql/tools/error-message-when-you-open-configuration-manager


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...