Get-VBRServer from Windows service tells SQL not available

PowerShell script exchange

Get-VBRServer from Windows service tells SQL not available

Veeam Logoby stsc_srzc » Wed Mar 26, 2014 3:02 pm

Hi everyone!

We have some PowerShell scripts that we start from a Windows service. This produces some unpredictable behaviours. By default the service runs with the "Local System" account. Mostly this works well. Sometimes we get the following message:

Code: Select all
Get-VBRServer : 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.


When then changing the account to e.g. a local administrator account. The "Get-VBRServer" runs fine again. The Veeam server is running fine all the time. I suspect the error message is due to some account right problems. Unfortunally I cannot figure out which rights this might be. So if some might give me I hint I would do some further researching.


Best regards
Stefan
stsc_srzc
Influencer
 
Posts: 10
Liked: 1 time
Joined: Thu Feb 21, 2013 11:53 am

Re: Get-VBRServer from Windows service tells SQL not availab

Veeam Logoby v.Eremin » Thu Mar 27, 2014 9:05 am

So, the scripts are executed with the use of Windows Schedule, right? What about adding "RunAs" commands to the script, so that, it's run under account with necessary permissions? Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get-VBRServer from Windows service tells SQL not availab

Veeam Logoby tdewin » Fri Mar 28, 2014 12:14 pm

Like Vladimir says, it all has to do with permissions. Please check
http://blog.dewin.me/2014/03/get-even-m ... veeam.html

and check for "Why I need to run with highest privileges"
tdewin
Veeam Software
 
Posts: 1043
Liked: 361 times
Joined: Fri Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin

[MERGED] : Run PowerShell Start Job not using Administrator

Veeam Logoby aa00001 » Thu Sep 04, 2014 7:56 am

Dear All,

I am using PowerShell to start a Veeam backup job in Windows 2008 without any problem with the Administrator account. If other user account was used to run the PowerShell for starting the job, exception was thrown :
Start-VBRJob : Exception has been thrown by the target of an invocation.

However, I would like to start the job by an other users (may be of administrators group but not Administrator) so that the use of Administrator account can be avoided

Grateful if anyone could share valuable experience.

Thanks.
aa00001
Lurker
 
Posts: 1
Liked: never
Joined: Thu Sep 04, 2014 7:43 am
Full Name: R L

Re: Get-VBRServer from Windows service tells SQL not availab

Veeam Logoby v.Eremin » Thu Sep 04, 2014 8:25 am

Hi,

Please see answers provided above and the article referenced by Timothy; should clarify situation for you.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get-VBRServer from Windows service tells SQL not availab

Veeam Logoby stsc_srzc » Tue Sep 09, 2014 1:21 pm 1 person likes this post

Hi everyone,

just for your information. The problem was solved by using a user with db_owner rights on the Veeam database.

Here is in more details what we observed. We do *not* use the Windows scheduler. We use a custom service that triggers the Powershell commands. The following applies to the logon acount for the service.

When using the database shipped with Veeam no "special" user customization is needed. Running Powershell commands with the system account works.

When using a standalone MSSQL Database (beginning from SQL 2008) you have to use a user with special rights (db_owner) granted to the database. In case you do not do this you can get the misleading message "Get-VBRServer : Microsoft SQL server hosting the configuration database is currently unavailable. ...".

Thanks to all
Stefan
stsc_srzc
Influencer
 
Posts: 10
Liked: 1 time
Joined: Thu Feb 21, 2013 11:53 am


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 3 guests