Requested registry access is not allowed error

PowerShell script exchange

Requested registry access is not allowed error

Veeam Logoby pmansfield » Wed 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.
pmansfield
Enthusiast
 
Posts: 28
Liked: never
Joined: Tue Jun 30, 2015 3:59 pm

Re: Requested registry access is not allowed error

Veeam Logoby v.Eremin » Wed Jul 08, 2015 11:42 am

Is the same account being used in both cases? Manual and scheduled runs, I mean.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Requested registry access is not allowed error

Veeam Logoby pmansfield » Wed Jul 08, 2015 1:07 pm

Yes, the same account is being used.
pmansfield
Enthusiast
 
Posts: 28
Liked: never
Joined: Tue Jun 30, 2015 3:59 pm

Re: Requested registry access is not allowed error

Veeam Logoby v.Eremin » Wed Jul 08, 2015 1:55 pm

What happens if you try to tick "Run with highest privileges" in Scheduled Task properties?
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Requested registry access is not allowed error

Veeam Logoby pmansfield » Thu 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.
pmansfield
Enthusiast
 
Posts: 28
Liked: never
Joined: Tue Jun 30, 2015 3:59 pm

Re: Requested registry access is not allowed error

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

Re: Requested registry access is not allowed error

Veeam Logoby pmansfield » Fri 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!
pmansfield
Enthusiast
 
Posts: 28
Liked: never
Joined: Tue Jun 30, 2015 3:59 pm

Re: Requested registry access is not allowed error

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


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 7 guests