NAME
Get-VBRJobObject
SYNOPSIS
Returns a specified job.
SYNTAX
Get-VBRJobObject [-Job] <CBackupJob> [-WarningAction <ActionPreference>] [-
WarningVariable <String>] [<CommonParameters>]
DESCRIPTION
Returns an object of the specified job.
PARAMETERS
-Job <CBackupJob>
Provide an object of the job that should be returned.
Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-WarningAction <ActionPreference>
Determines how the cmdlet responds to a warning from the command. "Cont
inue" is the default value. This parameter works only when the command
generates a warning message.
Valid values:
SilentlyContinue - suppresses the warning message and continues executi
ng the command.
Continue - displays the warning message and continues executing the com
mand. "Continue" is the default value.
Inquire - displays the warning message and prompts you for confirmation
before continuing execution.
Stop - displays the warning message and stops executing the command.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WarningVariable <String>
Stores warnings about the command in the specified variable.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".
INPUTS
OUTPUTS
NOTES
RELATED LINKS$ob = Get-VBRJobObject
...
$o = $ob[0]
$o.Delete()# Note: this script needs to run as an Administrator (i.e. run with elevated rights)
# on the Veeam server and under an account that has rights to vCenter
# Add the VMware and Veeam PowerShell Snap-Ins
add-pssnapin VMware.VimAutomation.Core
add-pssnapin VeeamPSSnapIn
# Connect to the virtual center server
Connect-VIServer -Server <vCenter Server Name>
# Locate the host the vCenter database server is running on
$vmname = "<vCenter Database Server Name>"
$vmhost = Get-VMHost -VM $vmname
$servername = $vmhost.Name
# Since the resolution for the VSS issue with the vCenter database suggested connecting the hosts by IP address,
# match the host name to the IP address
switch ($servername)
{
"esx1.domain.com" {$serverip = "10.0.0.1"}
"esx2.domain.com" {$serverip = "10.0.0.2"}
"esx3.domain.com" {$serverip = "10.0.0.3"}
"esx4.domain.com" {$serverip = "10.0.0.4"}
default {Write-Warning "Host name does not match IP listed"}
}
# Remove the old server entry from the backup job
$job = Get-VBRJob | where {$_.name -match "<jobname>"}
$oldvm = Get-VBRJobObject ($job)
$oldvm.Delete()
# Add the new server entry to the backup job
$server = Get-VBRServer | where {$_.name -eq $serverip}
Add-VBRJobObject ($job) -Server ($server) -Objects ($vmname)
Users browsing this forum: No registered users and 1 guest