New-SCExternalJob

Creates a new external job in VMM.

Syntax

New-SCExternalJob
   [-VMMServer <ServerConnection>]
   [-Name] <String>
   [-ResultObject <ClientObject>]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]

Description

The New-SCExternalJob cmdlet creates external jobs in Virtual Machine Manager (VMM).

External jobs add non-VMM jobs to the jobs view in the VMM console. These jobs are typically used to allow other applications integrating with VMM to serve status updates into the console so that users of the console can see the updates. For example, if you create an add-in, you might use external jobs to provide the status of work completed on another system.

Examples

Example 1: Create an external job

PS C:\> $VMMObject = Get-SCVirtualMachine -Name "VM01"
PS C:\> New-SCExternalJob -Name "ExternalJob01" -ResultObject $VMMObject

The first command gets the virtual machine object named VM01 and stores the object in the $VMMObject variable. The object in this command can be any VMM object for which you are creating a job.

The second command creates an external job named ExternalJob01 and relates the job to VM01 which is stored in the $VMMObject variable.

Required Parameters

-Name

Specifies the name of a VMM object.

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-OnBehalfOfUser

Specifies a user name. This cmdlet operates on behalf of the user that this parameter specifies.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OnBehalfOfUserRole

Specifies a user role. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

Type:UserRole
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResultObject

Specifies the object to which a new external job is related.

Type:ClientObject
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Outputs

Task

This cmdlet returns a Task object.