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 »

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.
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Requested registry access is not allowed error

Post by veremin »

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 »

Yes, the same account is being used.
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Requested registry access is not allowed error

Post by veremin »

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 »

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.
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Requested registry access is not allowed error

Post by veremin »

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 »

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!
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Requested registry access is not allowed error

Post by veremin »

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