Solved

Veeam Agent using VBAR, How to get JobID?


Userlevel 5
Badge +1

Hello and Thanks

My personal laptop runs VAgent(Veeam Agent for Microsoft Windows 6.0.0.960 - Server Edition)
My home server runs VBAR(12.0.0.1420)
Both are community editions.

Based on https://helpcenter.veeam.com/docs/agentforwindows/userguide/backup_cmd.html?ver=60
I have multiple jobs, so I need the JobID.

To Get the ID, I ran
"Get-VBRComputerBackupJob -Mode ManagedByAgent"

My problem, this command fails, i cannot figure out why?
C:\Program Files\Veeam\Endpoint Backup>Veeam.EndPoint.Manager.exe /backup "5c2b2cb9-7092-4a9e-8e4f-b08e0e18e168"
Job with id "5c2b2cb9-7092-4a9e-8e4f-b08e0e18e168" was not found


 

Output of “Get-VBRComputerBackupJob -Mode ManagedByAgent”
Id                              : 5c2b2cb9-7092-4a9e-8e4f-b08e0e18e168
Name                            : ABP_EN10
Description                     : Created by 192.168.62.233\administrator at 12/23/2022 4:22 PM.
OSPlatform                      : Windows
Type                            : Server
Mode                            : ManagedByAgent
BackupObject                    : {PG_EN10}
BackupType                      : SelectedVolumes
SelectedFilesOptions            :
SelectedVolumes                 : {Veeam.Backup.PowerShell.Infos.VBRWindowsSelectedVolume}
ExcludedVolumes                 :
UsbDrivesIncluded               : False
DestinationOptions              : Veeam.Backup.PowerShell.Infos.VBRComputerDestinationOptions
BackupRepository                :
RetentionPolicy                 : 730
StorageOptions                  : Veeam.Backup.PowerShell.Infos.VBRStorageOptions
SyntheticFullOptions            : Veeam.Backup.PowerShell.Infos.VBRSyntheticFullOptions
ActiveFullOptions               : Veeam.Backup.PowerShell.Infos.VBRFullBackupOptions
HealthCheckOptions              : Veeam.Backup.PowerShell.Infos.VBRHealthCheckOptions
CompactFullOptions              : Veeam.Backup.PowerShell.Infos.VBRFullBackupOptions
NotificationOptions             :
ScriptOptions                   :
DeletedComputerRetentionEnabled : False
DeletedComputerRetentionPolicy  : 30
ApplicationProcessingEnabled    : False
ApplicationProcessingOptions    : {Veeam.Backup.PowerShell.Infos.VBRApplicationProcessingOptions}
IndexingEnabled                 : False
IndexingOptions                 : {Veeam.Backup.PowerShell.Infos.VBRComputerIndexingOptions}
ScheduleEnabled                 : False
ScheduleOptions                 : Veeam.Backup.PowerShell.Infos.VBRServerScheduleOptions
JobEnabled                      : True
UseSnapshotlessFileLevelBackup  : False
BackupCacheOptions              : Veeam.Backup.PowerShell.Infos.VBRBackupCacheOptions
RetentionType                   : RestoreDays
GFSOptions                      : Veeam.Backup.PowerShell.Infos.VBRComputerGFSOptions
GFSRetentionEnabled             : False
WarningOptions                  : Enable=True, WarningPolicy=7
SanIntegrationOptions           : Veeam.Backup.PowerShell.Infos.VBRSanIntegrationOptions
IsHighPriority                  : False

 

 

 

icon

Best answer by asdffdsa6132 1 August 2023, 18:19

View original

12 comments

Userlevel 7
Badge +20

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.

Userlevel 5
Badge +1

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.

  1. Run backup job and Wait for VAgent to finish
  2. Run Restic
  3. Do stuff
  4. Send email
  5. 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: (:) [Get-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

 

Userlevel 7
Badge +20

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

Userlevel 7
Badge +20

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.

Userlevel 5
Badge +1

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.

 

newer version

OK

 

Thanks very much,
Dave

Userlevel 7
Badge +17

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.

Userlevel 5
Badge +1

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

Userlevel 7
Badge +20

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

Userlevel 7
Badge +12

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

 

Userlevel 5
Badge +1

@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!!!

Userlevel 5
Badge +1

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

 

Userlevel 7
Badge +20

@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.

Comment