The ID that you got was from VBR which is the Agent ID within the console and not the job ID from the local system. That is why the job is not running as you are trying to run it locally from the Agent install directory passing the ID from VBR so it will not recognize it. You should be able to run a similar command on the Agent system to get the job ID and run it that way or just run it from the VBR Console.
Thanks for the time, my ultimate goal is to run vagent from a simple .cmd script, where each command is ran in order. something like.
- Run backup job and Wait for VAgent to finish
- Run Restic
- Do stuff
- Send email
- Live long and prosper
That is a good idea, to run the command(s), on my laptop.
So, in a shell with admin privileges, i tried and failed.
Note: My laptop IP address is 192.168.62.235
PS D:\data> Get-VBRComputerBackupJob -Mode ManagedByAgent
Get-VBRComputerBackupJob : PowerShell client update environment initialization failed: Failed to connect to Veeam Backup & Replication server:
No connection could be made because the target machine actively refused it 192.168.62.235:9392
Execution environment cannot be initialized to Remote
At line:1 char:1
+ Get-VBRComputerBackupJob -Mode ManagedByAgent
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) rGet-VBRComputerBackupJob], AggregateException
+ FullyQualifiedErrorId : UpdateCheckerErrorId,Veeam.Backup.PowerShell.Cmdlets.GetVBRComputerBackupJob
PS D:\data> Get-VBREPJob
Get-VBREPJob : PowerShell client update environment initialization failed: Failed to connect to Veeam Backup & Replication server:
No connection could be made because the target machine actively refused it 192.168.62.235:9392
Execution environment cannot be initialized to Remote
At line:1 char:1
+ Get-VBREPJob
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) Get-VBREPJob], AggregateException
+ FullyQualifiedErrorId : UpdateCheckerErrorId,Veeam.Backup.PowerShell.Cmdlets.GetVBREpJob
I am not sure if this will help on the Agent machine or not since it is managed by VBR so this is probably another command to use but see if this works at all - Get-VBREPJob - Veeam Backup PowerShell Reference
Also, there is a newer version of the Agent you might want to update yours. And check the patch level for VBR as there was one released with July 18th date.
so this is probably another command to use but see if this works at all - Get-VBREPJob - Veeam Backup PowerShell Reference
Good suggestion, tho I believe i posted the output above.
OK
Thanks very much,
Dave
Were you able to run the cmd against your VBR server previously? My assumption is you can successfully run the cmd on the VBR server itself? Typically, when you can’t run PoSH against a remote system, it is because Windows Remote Management service is not running. Is that running on your VBR server? If not, start it then try to execute the PoSH cmd on your laptop again.
Hello @coolsport00,
In the past, I had a single backup job on my laptop and so this worked just fine.
"C:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.Manager.exe" /backup”
and I could use that in simple .cmd scripts. worked great and worked well over vpn.
Now that there are multiple jobs on my laptop, that command does not work, as it needs the jobid.
https://helpcenter.veeam.com/docs/agentforwindows/userguide/backup_cmd.html?ver=60
“If more than one backup job is configured:
"C:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.Manager.exe" /backup "<ID>"
Please, How do I find that ID, that is all I need, the ID?
Thanks,
David
Check here on your laptop to see if you can see the job names there and try that in the command - C:\ProgramData\Veeam\Endpoint
Try to export agent configuration to a xml file. The xml file will contain all jobs and their ID known by the agent:
https://helpcenter.veeam.com/docs/agentforwindows/configurator/export.html?ver=60
Veeam.Agent.Configurator.exe -export /f:C:\Veeam\Configuration.xml
@Chris.Childerhose, Thanks, I found the ID that VAgent requires!
From C:\ProgramData\Veeam\Endpoint\ABP_EN10\Job.Backup.log,
Starting new log
Log has been started by 'EN10\SYSTEM' user (Non-interactive)
Logging level: [4 (AboveNormal)]
MachineName: [EN10], HostName: [EN10], OS: [Microsoft Windows 11 Pro (10.0.22621)], CPU: [8]
Process: [64 bit], PID: [6568], SessionId: [0]
UTC Time: [7/29/2023 10:06:14 PM], DaylightSavingTime: [True]
Culture: [en-US], UI culture: [en-US]
Module: [C:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.Manager.exe]. File version: [6.0.0.960], Assembly version: [6.0.0.0]
CmdLineParams: [startbackupjob owner=[vbsvc] Normal 33be1920-881d-4212-9120-b742acf8e158 22eb854c-7a0c-45fb-a117-1fa3f7aa9686]
Not sure why, but these commands, as I posted up above, do not return that ID???
Get-VBRComputerBackupJob
Get-VBRComputerBackupJob -Mode ManagedByAgentver vpn
Looks like my script is working again and working over vpn.
I need to do a bit more testing tho.
THANKS!!!
Try to export agent configuration to a xml file. The xml file will contain all jobs and their ID known by the agent:
https://helpcenter.veeam.com/docs/agentforwindows/configurator/export.html?ver=60
Veeam.Agent.Configurator.exe -export /f:C:\Veeam\Configuration.xml
So I tried that and got back
Veeam.Agent.Configurator.exe -export /f:d:\files\zork
ExitCode: 3
Errors:
Failed to perform the operation.
Unable to complete the action because this backup agent is centrally managed by your system administrator.
ExitCode: 40
@Chris.Childerhose, Thanks, I found the ID that VAgent requires!
From C:\ProgramData\Veeam\Endpoint\ABP_EN10\Job.Backup.log,
Starting new log
Log has been started by 'EN10\SYSTEM' user (Non-interactive)
Logging level: [4 (AboveNormal)]
MachineName: [EN10], HostName: [EN10], OS: [Microsoft Windows 11 Pro (10.0.22621)], CPU: [8]
Process: [64 bit], PID: [6568], SessionId: [0]
UTC Time: [7/29/2023 10:06:14 PM], DaylightSavingTime: [True]
Culture: [en-US], UI culture: [en-US]
Module: [C:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.Manager.exe]. File version: [6.0.0.960], Assembly version: [6.0.0.0]
CmdLineParams: [startbackupjob owner=[vbsvc] Normal 33be1920-881d-4212-9120-b742acf8e158 22eb854c-7a0c-45fb-a117-1fa3f7aa9686]
Not sure why, but these commands, as I posted up above, do not return that ID???
Get-VBRComputerBackupJob
Get-VBRComputerBackupJob -Mode ManagedByAgentver vpn
Looks like my script is working again and working over vpn.
I need to do a bit more testing tho.
THANKS!!!
Not a problem glad it solved the issue for you. Be sure to mark the best answer within the thread so others can see it as well.