New-SCService

New-SCService

Deploys a new service instance in VMM.

Syntax

Parameter Set: Default
New-SCService -ServiceConfiguration <ServiceConfiguration> [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-Owner <String> ] [-PersistServiceConfiguration] [-PROTipID <Guid]> ] [-RunAsynchronously] [-UserRole <UserRole> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Detailed 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.

Parameters

-JobVariable<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OnBehalfOfUser<System.String>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-OnBehalfOfUserRole<Microsoft.SystemCenter.VirtualMachineManager.UserRole>

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Owner<String>

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

Example format: -Owner "Contoso\ReneeLo"

Example format: -Owner "ReneeLo@Contoso"

Aliases

none

Required?

false

Position?

named

Default Value

none

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid]>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsynchronously

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ServiceConfiguration<ServiceConfiguration>

Specifies a service configuration object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-UserRole<UserRole>

Specifies a user role object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Service

Examples

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

The first command gets the service configuration object named Contoso Service Configuration 01, and then 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.

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

Get-SCService

Read-SCService

Remove-SCService

Resume-SCService

Set-SCService

Start-SCService

Stop-SCService

Suspend-SCService

Update-SCService

Get-SCServiceConfiguration

Update-SCServiceConfiguration