I am trying to connect to an sql14 server via sqlps powershell module, but keep getting this error: Cannot find path 'SQLSERVER:\\SQL\\SERVER\\DEFAULT' because it does not exist'.
The server does exist and is responsive. I tried connecting to it with pssession, and that did work, but then trying again with sqlps module- failed.
Am I missing something else? other sql servers worked fine.
EDIT:
I found the solution! I changed the $debugpreference to 'continue'- and got a message: SQL Server PowerShell provider error: Could not connect to server. [Failed to connect to server . --> The target principal name is incorrect. Cannot generate SSPI context.]
with this message I managed to find out the spn for the sqlserver belonged to the computer account and not the user account running the services. I fixed that issue and managed to connect.
I found the solution! I changed the $debugpreference to 'continue'- and got a message: SQL Server PowerShell provider error: Could not connect to server. [Failed to connect to server . --> The target principal name is incorrect. Cannot generate SSPI context.]
with this message I managed to find out the spn for the sqlserver belonged to the computer account and not the user account running the services. I fixed that issue and managed to connect.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.