-
- Influencer
- Posts: 15
- Liked: never
- Joined: Jan 27, 2011 11:09 pm
- Full Name: James Smith
- Contact:
SQL error when running PowerShell script
As a corollary, when I call Powershell from a batch file and register the Veeam PSSnapin, I get a SQL error when the script tries to connect to return the data. When I run the command (and even my entire script) in the Powershell that's built in to Veeam, it works the way I want it to. Is there a switch or some parameters I need to add when I call Powershell or register the Veeam snap in? Or how would I call the Veeam-version of Powershell from my batch file?
Thanks!!
Thanks!!
-
- VP, Product Management
- Posts: 27325
- Liked: 2778 times
- Joined: Mar 30, 2009 9:13 am
- Full Name: Vitaliy Safarov
- Contact:
Re: SQL error when running PowerShell script
Hello James,
Could you please clarify what type of error do you see while running PowerShell script? On top of that, please take a look at this topic which explains how to run a PS script from a batch file.
Thank you!
Could you please clarify what type of error do you see while running PowerShell script? On top of that, please take a look at this topic which explains how to run a PS script from a batch file.
Thank you!
-
- Influencer
- Posts: 15
- Liked: never
- Joined: Jan 27, 2011 11:09 pm
- Full Name: James Smith
- Contact:
Re: SQL error when running PowerShell script
Sorry for the delayed response, I was out of town. Here is the error I get:
Thanks!
Code: Select all
Get-VBRBackupSession : SQL server is not available
At c:\veeamlog\DailyLog.ps1.ps1:10 char:23
+ Get-VBRBackupSession <<<< | where-object {$_.Info.CreationTime -gt $OneDayAgo} | ft | out-file "$Location\$File"
+ CategoryInfo : InvalidOperation: (Veeam.Backup.Po...BRBackupSession:GetVBRBackupSession) [Get-VBRBackupSession], CAppException
+ FullyQualifiedErrorId : Backup,Veeam.Backup.PowerShell.Command.GetVBRBackupSession
-
- VP, Product Management
- Posts: 27325
- Liked: 2778 times
- Joined: Mar 30, 2009 9:13 am
- Full Name: Vitaliy Safarov
- Contact:
Re: SQL error when running PowerShell script
James, let our support team investigate that, as I haven't seen this error before. I would also appreciate if you could update this topic with the resolution you find with our technical team.
-
- Influencer
- Posts: 15
- Liked: never
- Joined: Jan 27, 2011 11:09 pm
- Full Name: James Smith
- Contact:
Re: SQL error when running PowerShell script
Just wanted to follow up on this one. Running the batch file from a command prompt with administrator privileges works. When I configure it in Scheduled Tasks, there's a checkbox to run with the highest privileges, and it ran successfully this morning.
-
- Chief Product Officer
- Posts: 31707
- Liked: 7212 times
- Joined: Jan 01, 2006 1:01 am
- Location: Baar, Switzerland
- Contact:
Re: SQL error when running PowerShell script
Hi James, glad to hear this. Thank you very much for taking time to update your topic with the resolution, we do appreciate it.
Who is online
Users browsing this forum: No registered users and 2 guests