I am using a script that loads the following PowerShell SQL Server 2008 R2 plugins
Add-PSSnapin SqlServerCmdletSnapin100 Add-PSSnapin SqlServerProviderSnapin100
Then I call user-sql as follows:
Invoke-Sqlcmd -Query "select * from table" -ServerInstance xyz -Database abc -username xxxxxx -password yyyyyyy
I use the method to run a series of upgrade scripts in our databases. I pretty happily used this in our test environments, but then I tried it in production, and it turns out that we have a difference in server configurations. On our prod servers, named pipes are disabled for security reasons (apparently a worm attack), and our DBA does not want to enable it.
This is the error that I get, and the study says that this is a problem with named pipes - it starts working when I also turn them on.
INFO ERROR: Invoke-Sqlcmd: The connection was successfully established with the server, but then an error occurred during the login process. (provider: shared memory provider, error: 0 - no process is on the other end of the pipe.)
Does anyone know if there is a way to switch my script so that it does not require named pipes? Or is it a built-in connection method for invoke-sqlcmd, and I need to change my identity (if so, then any suggestions).
source share