1

我在 WinSvr 2012 上连接和执行 SQL 2012 SP1 的 PowerShell cmdlet 时遇到问题。

我正在同一网络上的另一台机器上执行 New-SPContenDatabase cmdlet。我在两个框中运行此 cmdlet 的帐户都是管理员。SQL Server 上的 sysadmin、serveradmin 和 public 角色中也有相同的帐户。

在远程机器上,我可以在相同的用户上下文下使用 SQL Management Studio 连接到 SQL Server,并执行所有操作,例如创建数据库和其他活动(如 sysadmin 角色所允许的)。

我还应该告诉你,我运行 cmdlet 的机器是 WinSvr 2008。

我正在尝试确定是否需要任何其他设置才能使此 cmdlet 正常工作。我记得在 SQL 2008 中,外围应用配置向导中有一个“远程连接”设置”,但我不确定这是否适用于这里,因为我可以使用 SQL Mgmt Studio 进行远程连接。

在 SQL 日志中,我没有看到任何登录错误或远程机器甚至正在执行任何操作的证据。

以下是执行 cmdlet 的机器的事件日志中的错误。

1)  Log Name:      Application
    Source:        Microsoft-SharePoint Products-SharePoint Foundation
    Date:          9/1/2013 1:07:52 PM
    Event ID:      5586
    Task Category: Database
    Level:         Error
    Keywords:      
    User:          CORP\xxxxx
    Computer:      xxxxx
    Description:
    Unknown SQL Exception 11001 occurred. Additional error information from SQL Server is included below.

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No such host is known.)
    Event Xml:


2)  Log Name:      Application
    Source:        Microsoft-SharePoint Products-SharePoint Foundation
    Date:          9/1/2013 1:07:03 PM
    Event ID:      3363
    Task Category: Database
    Level:         Critical
    Keywords:      
    User:          CORP\xxxxx
    Computer:      xxxxx
    Description:


    Cannot connect to database master at SQL server at example.com. The database might not exist, or the current user does not have permission to connect to it.

更新:我在 Mix 中添加了另一个 SQL 2008 R2 服务器,然后运行完全相同的 SharePoint Powershell 脚本,没有任何连接错误。这告诉我我在 SQL 2012 Server 上缺少某种类型的配置,这会阻止我连接或(不太可能)SharePoint cmdlet 不兼容。似乎 SQL Server 2012 需要指定端口 1433,无论我认为是什么导致了我的问题。如果我能让 SQL2012 不需要这个(就像 SQL 2008 一样),那么我想我会做生意的。

4

0 回答 0