PowerShell script exchange
Post Reply
pmansfield
Enthusiast
Posts: 45
Liked: never
Joined: Jun 30, 2015 3:59 pm
Contact:

Requested registry access is not allowed error

Post by pmansfield » Jul 08, 2015 8:41 am

I'm using the free version of B&R 8.0.0.2030, and am trying to use the VeeamZIP.ps1 script with Task Scheduler to set a backup of a VMware VMs.

If I load the script in PowerShell ISE and run it, then the backup executes as expected. If I try to run the script via a scheduled task, I get 3 identical errors appear in the Veeam Backup event log:

Code: Select all

Alternative log directory setting error : 
System.Security.SecurityException: Requested registry access is not allowed.
   at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
   at Veeam.Backup.Common.LogOptions.GetPreferedLogDir(String componentRegKey)
The Zone of the assembly that failed was:
MyComputer

Using default directory : C:\ProgramData\Veeam\Backup\
I see there are a couple of other posts about this error, but they all seemed to fade out without any resolution.

The B&R PC is running Windows 7 Pro x64, as it's just a quick setup to test a few concepts before deciding if we want to purchase the product.

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

Re: Requested registry access is not allowed error

Post by v.Eremin » Jul 08, 2015 11:42 am

Is the same account being used in both cases? Manual and scheduled runs, I mean.

pmansfield
Enthusiast
Posts: 45
Liked: never
Joined: Jun 30, 2015 3:59 pm
Contact:

Re: Requested registry access is not allowed error

Post by pmansfield » Jul 08, 2015 1:07 pm

Yes, the same account is being used.

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

Re: Requested registry access is not allowed error

Post by v.Eremin » Jul 08, 2015 1:55 pm

What happens if you try to tick "Run with highest privileges" in Scheduled Task properties?

pmansfield
Enthusiast
Posts: 45
Liked: never
Joined: Jun 30, 2015 3:59 pm
Contact:

Re: Requested registry access is not allowed error

Post by pmansfield » Jul 09, 2015 2:04 pm

Apologies for the slow responses :)

If I tick that, the job still doesn't run, but I don't get the errors in the event log either.

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

Re: Requested registry access is not allowed error

Post by v.Eremin » Jul 09, 2015 2:50 pm

Hmm, ISE part what happens if you logon with the same account, right click on the said script and choose Run with Powershell? Will the script proceed as expected?

pmansfield
Enthusiast
Posts: 45
Liked: never
Joined: Jun 30, 2015 3:59 pm
Contact:

Re: Requested registry access is not allowed error

Post by pmansfield » Jul 10, 2015 1:22 pm

Well, I don't know what happened - I swear I haven't changed anything, but now it's working. Manually kicking off the task worked, as did waiting for the scheduled task to fire on its timer.

Fingers crossed it stays working. Maybe that's why the other threads never really reached a definitive conclusion!

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

Re: Requested registry access is not allowed error

Post by v.Eremin » Jul 10, 2015 2:02 pm

Even though it took some time to get everything work, I'm glad to hear that now everything is operating as expected. Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests