PowerShell script exchange
Post Reply
stsc_srzc
Influencer
Posts: 23
Liked: 2 times
Joined: Feb 21, 2013 11:53 am
Contact:

Get-VBRServer from Windows service tells SQL not available

Post by stsc_srzc »

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
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

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

Post by veremin »

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.
tdewin
Veeam Software
Posts: 1818
Liked: 655 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

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

Post by tdewin »

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"
aa00001
Lurker
Posts: 1
Liked: never
Joined: Sep 04, 2014 7:43 am
Full Name: R L
Contact:

[MERGED] : Run PowerShell Start Job not using Administrator

Post by aa00001 »

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.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

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

Post by veremin »

Hi,

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

Thanks.
stsc_srzc
Influencer
Posts: 23
Liked: 2 times
Joined: Feb 21, 2013 11:53 am
Contact:

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

Post by stsc_srzc » 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
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests