New-SCService

Deploys a new service instance in VMM.

Syntax

New-SCService
   [-PersistServiceConfiguration]
   [-Owner <String>]
   [-VMMServer <ServerConnection>]
   -ServiceConfiguration <ServiceConfiguration>
   [-UserRole <UserRole>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]

Description

The New-SCService cmdlet deploys a new service instance into the Virtual Machine Manager (VMM) environment. You can create a service directly from a service template if no service instance configuration is needed, or from a service configuration.

Examples

Example 1: Deploy a service template using a service configuration that is stored in the library

PS C:\> $SvcConfig = Get-SCServiceConfiguration -Name "Service01"
PS C:\> Update-SCServiceConfiguration -ServiceConfiguration $SvcConfig
PS C:\> $NewService = New-SCService -ServiceConfiguration $SvcConfig 
PS C:\> $NewService

The first command gets the service configuration object named Contoso Service Configuration 01 and stores the object in the $SvcConfig variable.

The second command runs placement to update the service configuration stored in $SvcConfig.

The third command deploys the new service using the service configuration stored in $SvcConfig.

The last command displays the properties of the newly deployed service to the user.

Parameters

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

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

-OnBehalfOfUser

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

Type:String
Position:Named
Default value:None
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Owner

Specifies the owner of a VMM object in the form of a valid domain user account.

  • Example format: -Owner "Contoso\PattiFuller"
  • Example format: -Owner "PattiFuller@Contoso"
Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PersistServiceConfiguration

Indicates that the service deployment configuration is stored in the VMM library after the service is deployed.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ServiceConfiguration

Specifies a service configuration object.

Type:ServiceConfiguration
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-UserRole

Specifies a user role object.

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

-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Outputs

Service

This cmdlet returns a Service object.