PowerShell script exchange
Post Reply
habibalby
Veteran
Posts: 391
Liked: 32 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

Running Symantec Enterprise Vault Scripts by Invoke-Commad

Post by habibalby »

Hello,
I used to backup my Symantec Enterprise Vault server using pre&post scripts on Veeam Server, complete guide on how this works posted here in my blog; http://dailyvmtech.wordpress.com/2012/1 ... plication/

The physical server which was hosting Veeam Backup & Replication failed due to hardware error and I rebuild the server from scratch as I wasn't having physical backup image on the server,,, anyway here my question(s) to the issue I'm facing now.

The scripts I used to use are not working even If I run them manually on the Backup server, but works fine on the EVServer which means scripts are working perfectly.

Via Invoke-Command If I run the command manually on the Backup Server (Veeam) it works fine..

Code: Select all

Invoke-Command -ComputerName EVServer -FilePath .\SymantecEV-PretScript.ps1
If I save the script as .ps1 script and i configure Task Scheduler the script doesn't work at all even with PowerShell.exe -File "C:\Scripts\SymantecEV-PreScript.ps1"

SymantecEV-PreScript.ps1

Code: Select all

#Pre-job to set the Symantec Enterprise Server and Site into Backup Mode.

#Reset ArchiveBit on the Store Vaults.

DEL "\\EVServer\EVPartition01cc55b2dc699b70$\IgnoreArchiveBitTrigger.old"
DEL "\\EVServer\EVPartition01cc55b2753ddd30$\IgnoreArchiveBitTrigger.old"
DEL "\\EVServer\EVPartition01cc55b34882a450$\IgnoreArchiveBitTrigger.old"
DEL "\\EVServer\EVPartition01cc55b3725ff520$\IgnoreArchiveBitTrigger.old"

#Site: EV Site

#Set backup mode on site

c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Set-VaultStoreBackupMode -Name '[b]EVSiteName[/b]' -EVServerName evserver -EVObjectType Site}"

#SiteIndexLocations:  EV Site

#Set backup mode on indexes in site

c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Set-IndexLocationBackupMode -EVServerName 'evserver' -EVSiteName [b]'EVSiteName[/b]}"

#Start Veeam Backup Job
Add-PSSnapin VeeamPSSnapin

#Add the name of the backup jobs to be included here. The order in which they are entered is the order in which they will run

$chainedjobs = (“SymantecEV”)

foreach ($jobname in $chainedjobs){
$job = Get-VBRJob -name $jobname
$jobtry = 0
start-VBRJob -job $job
$job.GetLastResult()
if($job.GetLastResult() -eq “Failed”){
do{
Start-Sleep 480
Start-VBRJob -job $job -RetryBackup
$jobtry++
}
while(($jobtry -lt 3) -and ($job.GetLastResult() -eq “Failed”))
}
}
SymantecEV-PostScript.ps1

Code: Select all

#Post-job to Clear the Backup Mode on the Enterprise Site and EVServer.
#Create IgnoreArchiveBitTrigger.txt

echo "Enterprise Vault Trigger File"> "\\EVServer\EVPartition01cc55b2dc699b70$\IgnoreArchiveBitTrigger.txt"
echo "Enterprise Vault Trigger File"> "\\EVServer\EVPartition01cc55b2753ddd30$\IgnoreArchiveBitTrigger.txt"
echo "Enterprise Vault Trigger File"> "\\EVServer\EVPartition01cc55b34882a450$\IgnoreArchiveBitTrigger.txt"
echo "Enterprise Vault Trigger File"> "\\EVServer\EVPartition01cc55b3725ff520$\IgnoreArchiveBitTrigger.txt"

#Clear backup mode from site
c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Clear-VaultStoreBackupMode -Name '[b]EVSiteName[/b]' -EVServerName evserver -EVObjectType Site}"


#Clear backup mode from indexes in site
c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Clear-IndexLocationBackupMode -EVServerName evserver -EVSiteName 'EVSiteName'}"
I'm getting this to work only by manually running the scripts on PowerShell, if I use .bat script such as

Code: Select all

 PowerShell.exe c:\Scripts\PS1.ps1
it doesn't run.

In this situation, how I will be able to run the scripts on the Backup Server against EVServer and the scripts located in the backup Server?

Thanks,
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by veremin »

Is the account used for manual script execution and for script execution via Task Scheduler the same? Thanks.
habibalby
Veteran
Posts: 391
Liked: 32 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by habibalby »

Hi Eremin,

Yes I'm using the same account.
Thanks,
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by veremin »

Are you running scripts on 64-bit OS? There are two PS versions in 64-bit OS. So, you can try to specify direct path to either 32 or 64 version and see whether it makes any difference.

Instead of:

Code: Select all

PowerShell.exe -File "C:\Scripts\SymantecEV-PreScript.ps1" 
Try either (32):

Code: Select all

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -File "C:\Scripts\SymantecEV-PreScript.ps1
Or (64):

Code: Select all

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File "C:\Scripts\SymantecEV-PreScript.ps1
The required level of execution policy should be also set for both instances.

Thanks.
habibalby
Veteran
Posts: 391
Liked: 32 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by habibalby »

Thanks, let me try it will come back to you in awhile.

Regards,
bernardw
Influencer
Posts: 22
Liked: 4 times
Joined: Feb 20, 2013 6:21 pm
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by bernardw »

As an update to this post and to make it a bit easier for people to follow the steps in the future (if anyone else is looking to backup Enterprise Vault with Veeam).

Some things I learned as of Veeam 8:

Setup the VM backup with Pre and Post scripts (found under "guest Processing">Applications> Add a VM >Scripts

The Pre and Post scripts must be batch files. They are files that run on the VM being backed up and as the computer account.
the batch script needs to run a Powershell script with the Invoke command such as

Code: Select all

C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe Invoke-Command -ComputerName EVServerName -FilePath c:\temp\BackupEV-clearBackupmode.ps1
The content of the scripts continue to be the same as habibalby posted even in Enterprise Vault 11.1

I found the Pre and post VM script are the easiest to use as the freezing of the computer happens every time the backup of the Enterprise Vault server is run which also means it is not necessarily frozen when the other VMs are being backed up.
habibalby
Veteran
Posts: 391
Liked: 32 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by habibalby »

Part of my plan which I wrote today for the Exchange migration is to eliminate EV Server and use Exchange Archive features.. This will free me from Slow Backup due to the fact EV is very heavy VM.

Thanks,
ccampbell
Lurker
Posts: 2
Liked: never
Joined: Jul 02, 2015 4:01 pm
Full Name: Clinton J. Campbell
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by ccampbell »

This post, along with habibalby's prior wordpress post has saved me quite a bit of time in setting up Veeam for EV backup. Thank you.

I have one question in reference to the shift from running Veeam side to invoking on the EV server. I'll probably find the answer pretty easily in the documentation, but I figure it might be helpful for future users to record it here. My suspicion is that it no longer makes sense to launch the backup job from the powershell script itself since Veeam will run the pre-thaw. Is this accurate?

It does seem like we could make this a bit more robust by checking the return values of the scripts or verifying backup mode with the appropriate powershell commands. I don't have much time left to work on this now, but I'll post code if I get to it. Unless somebody else has a script they'd like to share???

Thanks again!
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by veremin »

I agree, now as we have pre-thaw scripts, it might be worth indeed placing the referenced scripts inside backup job, so that, everything is setup within one place. Thanks.
ccampbell
Lurker
Posts: 2
Liked: never
Joined: Jul 02, 2015 4:01 pm
Full Name: Clinton J. Campbell
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by ccampbell »

I made some progress, but I'm still having a bit of trouble. The script modifications aren't too bad. Within the .bat files, I simply complete with "exit /b %errorlevel%" to terminate the batch job and pass back the error level of the previous command. I was a bit more particular with the powershell. I decided that within the pre backup script, I wanted to be sure to clear backup mode if either of my powershell commands returned an error. The following block seems sufficient:

Code: Select all

if ($LastExitCode -ne 0) {
    c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Clear-VaultStoreBackupMode -Name 'sitename' -EVServerName servername -EVObjectType Site}"
    c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile "C:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Clear-IndexLocationBackupMode -EVServerName servername -EVSiteName 'sitename'}"
    throw "Exec: $ErrorMessage"
}
I did notice some flaky behavior with the Set/Clear-BackupMode commandlets, and I may update these scripts with a version that verifies the actual state using the Get-BackupMode command lets. First, I'm aiming for a fully working test.

Now, where I'm running into issues is how to set up the actual jobs. Enterprise Vault runs on its own VM while we have a separate application VM for the SQL Server hosting the Vault databases. I currently run pre-thaw on the first of the listed servers and post-thaw on the second. Since the servers backup in parallel, I'm not sure this is sufficient (still seeing errors on my scripts). I am thinking about separating the jobs since we can tell the database server to begin immediately after the Vault server completes. I was also planning to give the Powershell guide a look to see if there was a good way to hold the post-thaw until backup processing completes (note there is a way to set a script to run pre/post-job), but I was having permission issues with this approach.
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by veremin »

Post-thaw script runs, when VSS snapshot is created. So, I don't think it's possible to let it wait till the whole processing is finished.

The post-job activity might be a better idea, indeed. Can you tell us what particular permission issue you had?

Thanks.
omitv
Influencer
Posts: 16
Liked: never
Joined: Sep 29, 2013 2:37 pm
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by omitv »

I started in a new company and here they have created the pre and post scripts to run in the Enterprise Vault server as scheduled tasks before the Veeam backup kicks in. This has worked but in june the backups have no longer been able to backup the EV database and transaction logs (or that's what Enterprise Vault management console complains). In my previous job I had the backups run with pre and post scripts in the Veeam server.

Pre script:
REM Pre-job to set the Symantec Enterprise Server and Site into Backup Mode.
REM Reset ArchiveBit on the Store Vaults.

DEL "E:\MailVault\Partition1\IgnoreArchiveBitTrigger.old"
DEL "G:\MailVault2\Partition1\IgnoreArchiveBitTrigger.old"


REM Set backup mode to site

C:\WINDOWS\SysWOW64\windowspowershell\v1.0\powershell -psconsolefile "d:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Set-VaultStoreBackupMode -Name EVsite -EVServerName EVserver -EVObjectType Site}"


Post script:
REM Post-job to Clear the Backup Mode on the Enterprise Site and EVServer.
REM Create IgnoreArchiveBitTrigger.txt

echo "Enterprise Vault Trigger File"> "E:\MailVault\Partition1\IgnoreArchiveBitTrigger.txt"
echo "Enterprise Vault Trigger File"> "G:\MailVault2\Partition1\IgnoreArchiveBitTrigger.txt"


REM Clear backup mode from site

C:\WINDOWS\SysWOW64\windowspowershell\v1.0\powershell -psconsolefile "d:\Program Files (x86)\Enterprise Vault\EVShell.psc1" -command "& {Clear-VaultStoreBackupMode -Name EVsite -EVServerName EVserver -EVObjectType Site}"

When I run the pre script the archive files are deleted and the vault stores are set to backup mode (Indexes are not in backup mode). The post script also takes the vault stores from backup mode so it seems to work also. What am I missing here?
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by veremin »

This has worked but in june the backups have no longer been able to backup the EV database and transaction logs (or that's what Enterprise Vault management console complains).
Can you elaborate on that? Did you get any specific error? Or the script didn't seem to work at all?
omitv
Influencer
Posts: 16
Liked: never
Joined: Sep 29, 2013 2:37 pm
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by omitv »

I just found out that they moved the Veeam to another server and it hasn't worked since.

I have returned to the way that I had it running in my previous employer. I have a prescript.bat that is initiated by Windows task scheduler which runs a powershell script:

Code: Select all

#Pre-job to set the Symantec Enterprise Server and Site into Backup Mode.
#Reset ArchiveBit on the Store Vaults.

DEL "\\ARCHIVE-2\EVPartition01cc011476c3aa10$\IgnoreArchiveBitTrigger.old"
DEL "\\ARCHIVE-2\EVPartition01ce9fd766f4d730$\IgnoreArchiveBitTrigger.old"

#Site: EV Site

#Set backup mode on site
c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile “C:\Program Files (x86)\Enterprise Vault\EVShell.psc1” -command “& {Set-VaultStoreBackupMode -Name ‘Mysite’ -EVServerName enterprisevault.mydomain.fi -EVObjectType Site}”

#SiteIndexLocations:  EV Site

#Set backup mode on indexes in site
c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile “C:\Program Files (x86)\Enterprise Vault\EVShell.psc1” -command “& {Set-IndexLocationBackupMode -EVServerName enterprisevault.mydomain.fi -EVSiteName ‘Mysite’}”

#Start Veeam Backup Job

Add-PSSnapin VeeamPSSnapin

# Add the name of the backup jobs to be included here. The order in which they are entered is the order in which they will run

$chainedjobs = (“Archive-2”)

foreach ($jobname in $chainedjobs){
$job = Get-VBRJob -name $jobname
$jobtry = 0
start-VBRJob -job $job

$job.GetLastResult()
if($job.GetLastResult() -eq “Failed”){
do{
Start-Sleep 480
Start-VBRJob -job $job -RetryBackup
$jobtry++
}
while(($jobtry -lt 3) -and ($job.GetLastResult() -eq “Failed”))
}
}
And then the post script that is configured in the backup job properties.

Code: Select all

#Post-job to Clear the Backup Mode on the Enterprise Site and EVServer.
#Create IgnoreArchiveBitTrigger.txtecho “Enterprise Vault Trigger File”> “\\EVServer\EVPartition01cc55b2dc699b70$\IgnoreArchiveBitTrigger.txt”
echo “Enterprise Vault Trigger File”> “\\ARCHIVE-2\EVPartition01cc011476c3aa10$\IgnoreArchiveBitTrigger.txt”
echo “Enterprise Vault Trigger File”> “\\ARCHIVE-2\EVPartition01ce9fd766f4d730$\IgnoreArchiveBitTrigger.txt”
#Clear backup mode from site

c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile “C:\Program Files (x86)\Enterprise Vault\EVShell.psc1” -command “& {Clear-VaultStoreBackupMode -Name ‘Mysite’ -EVServerName enterprisevault.mydomain.fi -EVObjectType Site}”

#Clear backup mode from indexes in site

c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile “C:\Program Files (x86)\Enterprise Vault\EVShell.psc1” -command “& {Clear-IndexLocationBackupMode -EVServerName enterprisevault.mydomain.fi -EVSiteName ‘Mysite’}” 
The pre script successfully sets the vault and indexes in to backup mode but it fails with the rest of the code (starting the veeam backup job). The post script successfully removes the vault stores and indexes from backup mode. When I run the prescript with the account that is also set to run the Veeam services I receive following errors:

Code: Select all

Successfully set backup mode on the vault stores on Enterprise Vault server 'archive.Dittmar.fi'.
Successfully set backup mode on all vault stores in site 'Dittmar'.
Successfully set backup mode on all index locations on Enterprise Vault server 'archive.Dittmar.fi'.
Successfully set backup mode on all index locations in site 'Dittmar'.
Add-PSSnapin : The Windows PowerShell snap-in 'VeeamPSSnapin' is not installed on this computer.
At S:\scripts\PreJob.ps1:19 char:1
+ Add-PSSnapin VeeamPSSnapin
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (VeeamPSSnapin:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

Get-VBRJob : The term 'Get-VBRJob' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At S:\scripts\PreJob.ps1:26 char:8
+ $job = Get-VBRJob -name $jobname
+        ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-VBRJob:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

start-VBRJob : The term 'start-VBRJob' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At S:\scripts\PreJob.ps1:28 char:1
+ start-VBRJob -job $job
+ ~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (start-VBRJob:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

You cannot call a method on a null-valued expression.
At S:\scripts\PreJob.ps1:30 char:1
+ $job.GetLastResult()
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At S:\scripts\PreJob.ps1:31 char:4
+ if($job.GetLastResult() -eq "Failed"){
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

PS S:\scripts>

And I have run the installer stated in the following article: http://www.veeam.com/kb1489 and rebooted the server but that didn't have any affect.

Ps. I have a support ticket opened (case 00993987)
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by veremin »

I think PowerShell snap-in reinstallation might be required here. Let me know how the process goes. Thanks.
omitv
Influencer
Posts: 16
Liked: never
Joined: Sep 29, 2013 2:37 pm
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by omitv »

I followed the instructions and got the powershell snap-in working. However there is still some problem.

Code: Select all

PS S:\Scripts> powershell.exe .\PreJob.ps1
Successfully set backup mode on the vault stores on Enterprise Vault server 'archive.Dittmar.fi'.
Successfully set backup mode on all vault stores in site 'Dittmar'.
Successfully set backup mode on all index locations on Enterprise Vault server 'archive.Dittmar.fi'.
Successfully set backup mode on all index locations in site 'Dittmar'.
Get-VBRJob : Requested registry access is not allowed.
At S:\Scripts\PreJob.ps1:26 char:8
+ $job = Get-VBRJob -name $jobname
+        ~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], SecurityException
    + FullyQualifiedErrorId : System.Security.SecurityException

start-VBRJob : Requested registry access is not allowed.
At S:\Scripts\PreJob.ps1:28 char:1
+ start-VBRJob -job $job
+ ~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], SecurityException
    + FullyQualifiedErrorId : System.Security.SecurityException

You cannot call a method on a null-valued expression.
At S:\Scripts\PreJob.ps1:30 char:1
+ $job.GetLastResult()
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At S:\Scripts\PreJob.ps1:31 char:4
+ if($job.GetLastResult() -eq "Failed"){
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

PS S:\Scripts>

[b]The PreScript goes[/b] 

#Pre-job to set the Symantec Enterprise Server and Site into Backup Mode.
#Reset ArchiveBit on the Store Vaults.

DEL "\\ARCHIVE-2\EVPartition01cc011476c3aa10$\IgnoreArchiveBitTrigger.old"
DEL "\\ARCHIVE-2\EVPartition01ce9fd766f4d730$\IgnoreArchiveBitTrigger.old"

#Site: EV Site

#Set backup mode on site
c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile “C:\Program Files (x86)\Enterprise Vault\EVShell.psc1” -command “& {Set-VaultStoreBackupMode -Name ‘Dittmar’ -EVServerName enterprisevault.dittmar.fi -EVObjectType Site}”

#SiteIndexLocations:  EV Site

#Set backup mode on indexes in site
c:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -psconsolefile “C:\Program Files (x86)\Enterprise Vault\EVShell.psc1” -command “& {Set-IndexLocationBackupMode -EVServerName enterprisevault.dittmar.fi -EVSiteName ‘Dittmar’}”

#Start Veeam Backup Job

Add-PSSnapin VeeamPSSnapin

# Add the name of the backup jobs to be included here. The order in which they are entered is the order in which they will run

$chainedjobs = (“Archive-2”)

foreach ($jobname in $chainedjobs){
$job = Get-VBRJob -name $jobname
$jobtry = 0
start-VBRJob -job $job

$job.GetLastResult()
if($job.GetLastResult() -eq “Failed”){
do{
Start-Sleep 480
Start-VBRJob -job $job -RetryBackup
$jobtry++
}
while(($jobtry -lt 3) -and ($job.GetLastResult() -eq “Failed”))
}
}
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by veremin »

Seems like account used to start those tasks lacking required permissions? What happens if you trigger this script manually, using the very same account?
omitv
Influencer
Posts: 16
Liked: never
Joined: Sep 29, 2013 2:37 pm
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by omitv »

The same happens. The account used is the same account that runs Veeam's services, It is a domain admin and authorized to run as a service. The account is also authorized in Enterprise Vault (as it is able to set the backup mode on and off). I don't know what other permissions I can provide for the user :(
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by veremin »

Hmm, I'm just guessing here, but can you tell me whether UAC is enabled on the given machine? If so, can you disable it temporarily and double-check whether the issue persists?
omitv
Influencer
Posts: 16
Liked: never
Joined: Sep 29, 2013 2:37 pm
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by omitv »

The UAC is set to never notify (off) so that's not it. :(
omitv
Influencer
Posts: 16
Liked: never
Joined: Sep 29, 2013 2:37 pm
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by omitv »

Actually there is no error and everything works if I run Veeam B&R with the account and start the powershell script from the powershell toolkit. However enterprise vault still complains that the database and transaction logs haven't been backed up.
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by veremin »

Not sure whether I follow you. You said that you got the very same error (Requested registry access is not allowed) when you started the script manually. Now it doesn't seem to be the case.

Can you elaborate a bit, please?

Thanks.
omitv
Influencer
Posts: 16
Liked: never
Joined: Sep 29, 2013 2:37 pm
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by omitv »

My apologies for being unclear.

If I run windows powershell on the server where Veeam is installed with the account and run the script, EV is set to backup mode but then I receive that error.

If I start Veeam B&R with the account and then from the menu start the Veeam B&R powershell an run the script, the script runs without errors, sets the EV to backup mode, runs the backup and removes the EV from backup mode.
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by veremin »

If I were you, I'd probably open a ticket with our support team, and let them confirm script content, as well as, account used, since it's getting a bit hard to troubleshoot those issues via forum correspondence. Thanks.
bisco
Lurker
Posts: 2
Liked: never
Joined: Aug 24, 2018 8:06 pm
Full Name: Brandenburg
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by bisco »

OMITV,

Was this problem ever fixed? I have the same exact issue right now.
Dima P.
Product Manager
Posts: 14396
Liked: 1568 times
Joined: Feb 04, 2013 2:07 pm
Full Name: Dmitry Popov
Location: Prague
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by Dima P. »

Hello bisco.

Unfortunately we cannot comment the resolution since we did not receive the case ID from original poster. If you want to get this issue resolved, kindly open a support case and do not forget to share the case ID in this thread. Thank you in advance.
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests