Compartilhar via


New-SCExternalJob

Creates a new external job in VMM.

Syntax

Default (Default)

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.

Parameters

-Name

Specifies the name of a VMM object.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OnBehalfOfUser

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:UserRole
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResultObject

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

Parameter properties

Type:ClientObject
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VMMServer

Specifies a VMM server object.

Parameter properties

Type:ServerConnection
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

Task

This cmdlet returns a Task object.