自动打开命名管道和 tcp\ip
我正在安装一个需要修改 SQL Server 的新产品。
具体来说,启用 tcp/ip 并打开命名管道。我知道如何手动完成。我想要的是一种通过 SQL 或 C# 代码为新客户自动化执行此操作的方法。
我希望有任何关于正确方向的建议。
I am working on an install of a new product that requires modifications to SQL Server.
Specifically, enable tcp/ip and turning on named pipes. I know how to do it manually. What i want is a way to automate this for a new customer though SQL or with C# code.
I would love any suggestions for the right direction.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 C# 和服务器管理对象 (SMO) 来完成此操作。您需要的类位于 Microsoft.SqlServer.Smo 和 Microsoft.SqlServer.WmiManagement 库中。
这是我使用过的 Powershell 片段,它使用相同的对象。希望它能为您指明正确的道路。
You can use C# and Server Management Objects (SMO) to do it. The classes you need are in the Microsoft.SqlServer.Smo and Microsoft.SqlServer.WmiManagement libraries.
Here's a Powershell snippet I've used that uses the same objects. Hopefully, it will point you down the right path.