Remote Powershell - SQL Server Unavailable

PowerShell script exchange

Remote Powershell - SQL Server Unavailable

Veeam Logoby ekisner » Mon Oct 27, 2014 5:43 pm

I have a powershell module in which I create and collect useful powershell commands. I have decided to make one which will give me, for each VM:
VMname, Replica (if any), latest snapshot of replica, Whether or not it has a B2D job, the most recent B2D restore point, and the number of B2D points that it has.

I have most of it working. Except for the fact that I have two B&R servers running, one for replication and one for B2D/tape. The one which does the replication also hosts the database via MS SQL express.

When I run my invoke-command on the one which locally houses the database, the command returns results no problem. When I run my invoke-command on the other, just a simple {asnp VeeamPSSnapIn; $result = get-vbrjob; $result} I get an error that the configuration database is inaccessible.
Code: Select all
Microsoft SQL server hosting the configuration database is currently unavailable. Possible reasons are heavy load,
networking issue, server reboot, or hot backup.
Please wait, and try again later.
Error information:
SQL server is not available


Having done some reading, the biggest issue looks like it is credentials. Both B&R server services use the same domain credentials, which are mapped to DBO. My local user exists within the local administrators group, and as well has explicitly defined permissions giving me owner and sysadmin on both of the B&R databases, which produced no change in the error message. The commands do work just fine when run locally on the server.

Anyone have any suggestions?
ekisner
Expert
 
Posts: 131
Liked: 31 times
Joined: Thu Jul 26, 2012 8:04 pm
Full Name: Erik Kisner

Re: Remote Powershell - SQL Server Unavailable

Veeam Logoby pizzim13 » Mon Oct 27, 2014 7:04 pm

This is due to powershell not be able to pass your creds correctly. You need to enable CredSSP for second hop. http://blogs.msdn.com/b/powershell/arch ... count.aspx
pizzim13
Enthusiast
 
Posts: 86
Liked: 6 times
Joined: Thu Apr 21, 2011 7:37 pm

Re: Remote Powershell - SQL Server Unavailable

Veeam Logoby v.Eremin » Mon Oct 27, 2014 7:50 pm

And this topic might shed a light on the experienced behaviour. Thanks.
v.Eremin
Veeam Software
 
Posts: 13293
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Remote Powershell - SQL Server Unavailable

Veeam Logoby ekisner » Mon Oct 27, 2014 9:12 pm

Thank you for your replies, both of you.

I had indeed enabled CredSSP on both of the servers, however reading through it again I saw that I needed to enable it on my local workstation as well.

It's a bit annoying to have to throw up a credential prompt, but it's far less annoying than gathering all the data by hand :)
ekisner
Expert
 
Posts: 131
Liked: 31 times
Joined: Thu Jul 26, 2012 8:04 pm
Full Name: Erik Kisner


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests