Comprehensive data protection for all workloads
Post Reply
Tecbil
Enthusiast
Posts: 31
Liked: 3 times
Joined: Apr 08, 2016 6:20 am
Contact:

Pre-Job Script

Post by Tecbil »

Hi everyone

I'm trying to run a pre-job script to remote shutdown a virtual machine inside the domain before backing it up but it just won't work.
The .bat-file I've created looks like this:

shutdown.exe -m \\[computername] -s -f -t 1

If I run the script manually with the domain-admin-account it works fine so it seems that Backup & Replication does not have the rights to shutdown the remote-computer. Anyone knows how I can give it the rights so the script will be executed at the target machine?

Thanks
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Pre-Job Script

Post by veremin »

What happens if you execute manually the very same script again, but this time under Veeam service account? Thanks.
Tecbil
Enthusiast
Posts: 31
Liked: 3 times
Joined: Apr 08, 2016 6:20 am
Contact:

Re: Pre-Job Script

Post by Tecbil »

The veeam service account? You mean the user with whom I log in to manage backup & replication? It's a memeber of the domain admin group and it works fine this way.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Pre-Job Script

Post by veremin »

Nope, the one under which Veeam-related services are running.
Tecbil
Enthusiast
Posts: 31
Liked: 3 times
Joined: Apr 08, 2016 6:20 am
Contact:

Re: Pre-Job Script

Post by Tecbil »

Oh, now I got you. When I try to run it with the local system account (that's the "user" the veeam backup service is running on) it says "permission denied" in the command prompt.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Pre-Job Script

Post by veremin »

Account lacks required permissions - this is the reason why automatically executed pre-job script fails. Thanks.
Tecbil
Enthusiast
Posts: 31
Liked: 3 times
Joined: Apr 08, 2016 6:20 am
Contact:

Re: Pre-Job Script

Post by Tecbil »

Do you know how I can give the "System" the rights to execute that batch file successfully?
Or is it better to run the Veeam-Service as a user that has these rights?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Pre-Job Script

Post by veremin »

Or is it better to run the Veeam-Service as a user that has these rights?
This. Thanks.
Tecbil
Enthusiast
Posts: 31
Liked: 3 times
Joined: Apr 08, 2016 6:20 am
Contact:

Re: Pre-Job Script

Post by Tecbil »

ok, i did it and it works now. thank you.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Pre-Job Script

Post by veremin »

Pre/Post job scripts are executed under account specified for Veeam-specific services. Thus, everything started to work, as soon as you granted it required permissions.

Glad to hear that you're up and running now.

Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 158 guests