Backup Exec Management Command Line Interface Help
Wait-BEJob Cmdlet
Synopsis

Waits for a job to complete in Backup Exec.

Syntax
Wait-BEJob -InputObject [<BEJob[]>] [-Any [<SwitchParameter>]] [-TimeoutSeconds [<Int32>]] [-WhatIf [<SwitchParameter>]] [-Confirm [<SwitchParameter>]] [<CommonParameters>]
Description

Waits for a job to complete in Backup Exec.

Wait-BEJob returns the job histories associated with the jobs that complete.

If you do not specify the -TimeoutSeconds, Wait-BEJob waits indefinitely for the specified jobs to complete.

If you specify the -TimeoutSeconds parameter and the time is exceeded before a job completes, the command returns even if the job is still running. No error message displays.

Parameters

-Any <SwitchParameter>

Specifies that Wait-BEJob return after any of the jobs complete if multiple jobs are waiting to complete.


Required false
Position Named
Accepts pipeline input false
Accepts wildcard characters false


-TimeoutSeconds <Int32>

Determines the maximum wait time for each job in seconds. If the time is exceeded before the job completes, the command returns even if the job is still running. No error message displays.


Required false
Position Named
Accepts pipeline input false
Accepts wildcard characters false


-InputObject <BEJob[]>

Specifies one or more job objects. Enter a variable that contains the objects, or type a command or expression that gets the objects.


Required true
Position Named
Accepts pipeline input true (ByValue)
Accepts wildcard characters false


-WhatIf <SwitchParameter>

Describes what happens if you execute the command without actually executing the command.


Required false
Position Named
Accepts pipeline input false
Accepts wildcard characters false


-Confirm <SwitchParameter>

Prompts you for confirmation before executing the command.


Required false
Position Named
Accepts pipeline input false
Accepts wildcard characters false


<CommonParameters>

For more information about common parameters, type "Get-Help about_commonparameters".

Input Type
BackupExec.Management.CLI.BEJob

You can pipe a Backup Exec job object to Wait-BEJob.

Return Value
BackupExec.Management.CLI.BEJobHistory

Wait-BEJob returns a Backup Exec job history object if the -TimeoutSeconds time is not exceeded, otherwise nothing is returned.

Examples

Example 1

C:\PS> Get-BEJob "Job 0001" | Wait-BEJob

These commands wait for a job named "Job 0001" to complete.


Example 2
C:\PS> Get-BEAgentServer myserver.mycompany.com | Submit-BEOnetimeBackupJob | Wait-BEJob

These commands submit a one-time backup that backs up a server named "myserver.mycompany.com" and waits for the job to complete.

Related Links

Get-BEJob
Get-BEAgentServer
Submit-BEOnetimeBackupJob