I am trying to use the invoke-sqlcmd on a SQL Server Cluster but it fails to execute and produces the following error:
invoke-sqlcmd : A network-related or instance-specific error occurred while establishing a coection 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 coections. (provider: Named Pipes Provider, error: 40 - Could not open a coection to SQL Server) At C:rs-pkgsSitecoreDeployScriptsSitecoreDatabasesDeploy.ps1:128 char:1 + invoke-sqlcmd -InputFile $inputFilePath + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlException + FullyQualifiedErrorId : SqlExectionError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
I am able to execute my script successfully on a development SQL Box that is not clustered. Here is an example of the SQL invocation:
$scriptPath = "C:"
$scriptName = "MyScript.sql"
$inputFilePath = "{0}{1}" -f $scriptPath,$scriptName
invoke-sqlcmd -InputFile $inputFilePath
So the question is this a Cluster issue or a security issue with remote coections not being allowed? How do I get the SQL Scripts to execute from PowerShell (the execute correctly if I open them in SSMS and press execute).
