Running Symantec Enterprise Vault Scripts by Invoke-Commad

PowerShell script exchange

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Veeam Logoby omitv » Mon Aug 24, 2015 7:11 am

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”))
}
}
omitv
Influencer
 
Posts: 15
Liked: never
Joined: Sun Sep 29, 2013 2:37 pm

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Veeam Logoby v.Eremin » Mon Aug 24, 2015 11:17 am

Seems like account used to start those tasks lacking required permissions? What happens if you trigger this script manually, using the very same account?
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Veeam Logoby omitv » Mon Aug 24, 2015 12:29 pm

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 :(
omitv
Influencer
 
Posts: 15
Liked: never
Joined: Sun Sep 29, 2013 2:37 pm

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Veeam Logoby v.Eremin » Mon Aug 24, 2015 12:42 pm

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?
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Veeam Logoby omitv » Mon Aug 24, 2015 5:23 pm

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

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Veeam Logoby omitv » Tue Aug 25, 2015 5:33 am

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.
omitv
Influencer
 
Posts: 15
Liked: never
Joined: Sun Sep 29, 2013 2:37 pm

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Veeam Logoby v.Eremin » Tue Aug 25, 2015 8:36 am

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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Veeam Logoby omitv » Tue Aug 25, 2015 10:36 am

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.
omitv
Influencer
 
Posts: 15
Liked: never
Joined: Sun Sep 29, 2013 2:37 pm

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Veeam Logoby v.Eremin » Mon Aug 31, 2015 12:10 pm

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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Previous

Return to PowerShell



Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests