PowerShell script exchange
omitv
Influencer
Posts: 15
Liked: never
Joined: Sep 29, 2013 2:37 pm
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by omitv » 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”))
}
}

v.Eremin
Product Manager
Posts: 15967
Liked: 1284 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by v.Eremin » 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?

omitv
Influencer
Posts: 15
Liked: never
Joined: Sep 29, 2013 2:37 pm
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by omitv » 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 :(

v.Eremin
Product Manager
Posts: 15967
Liked: 1284 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by v.Eremin » 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?

omitv
Influencer
Posts: 15
Liked: never
Joined: Sep 29, 2013 2:37 pm
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by omitv » 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: Sep 29, 2013 2:37 pm
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by omitv » 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.

v.Eremin
Product Manager
Posts: 15967
Liked: 1284 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by v.Eremin » 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.

omitv
Influencer
Posts: 15
Liked: never
Joined: Sep 29, 2013 2:37 pm
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by omitv » 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.

v.Eremin
Product Manager
Posts: 15967
Liked: 1284 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Running Symantec Enterprise Vault Scripts by Invoke-Comm

Post by v.Eremin » 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.

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 » Aug 24, 2018 9:04 pm

OMITV,

Was this problem ever fixed? I have the same exact issue right now.

Dima P.
Product Manager
Posts: 9605
Liked: 755 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. » Aug 27, 2018 11:56 am

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 3 guests