如何使用 powershell 配置 SQL Native Client? [英] How to configure SQL Native Client with powershell?

查看:39
本文介绍了如何使用 powershell 配置 SQL Native Client?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的任务是编写一个脚本,该脚本将为 SQL Server 2008 Express R2 实例启用 tcp 和命名管道协议.我已经找到了如何为 SQL Server 实例本身启用这些协议,但我还没有找到任何方法来从 powershell 控制 SQL Native Client.

I have been tasked to write a script that will enable tcp and named pipes protocols for SQL Server 2008 Express R2 instance. I have found out how to enable these protocols for the SQL Server instance itself, but I haven't found any way to control the SQL Native Client from powershell.

我的脚本是安装程序的一部分,我正在安装的代码需要启用这些协议.

My script is part of an installer, and the code I am installing expects these protocols to be enabled.

谢谢

推荐答案

我终于找到了解决方案.可以通过设置注册表项来启用协议:

I finally found the solution. The protocols can be enabled by setting a registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\SNI10.0 中,设置 ProtocolOrder 键以包含应启用的协议:

in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\SNI10.0, set the ProtocolOrder key to contain the protocols that should be enabled:

sm = Shared memory
np = Named pipes
tcp = TCP (he)
via = Via

未在此密钥中列出的协议将被禁用.

Protocols not listed in this key will be disabled.

这篇关于如何使用 powershell 配置 SQL Native Client?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆