Share via


Get-SCServicingWindowSubscription

Get-SCServicingWindowSubscription

Gets a list of servicing window subscriptions.

Syntax

Parameter Set: Connection
Get-SCServicingWindowSubscription [[-ServicingWindow] <ServicingWindow> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: FromHost
Get-SCServicingWindowSubscription [[-ServicingWindow] <ServicingWindow> ] -VMHost <Host> [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: FromService
Get-SCServicingWindowSubscription [[-ServicingWindow] <ServicingWindow> ] -Service <Service> [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: FromVM
Get-SCServicingWindowSubscription [[-ServicingWindow] <ServicingWindow> ] -VM <VM> [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Detailed Description

The Get-SCServicingWindowSubscription cmdlet gets a list of servicing window subscriptions.

Parameters

-Service<Service>

Specifies a Virtual Machine Manager (VMM) service object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ServicingWindow<ServicingWindow>

Specifies a servicing window object.

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VM<VM>

Specifies a virtual machine object.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMHost<Host>

Specifies a virtual machine host object. VMM supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts.

For more information about each type of host, type Get-Help Add-SCVMHost -detailed.

Aliases

none

Required?

true

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.

  • ServicingWindowSubscription

    This cmdlet returns a ServicingWindowSubscription object.

Examples

Example 1: Get a list of a servicing window subscriptions for a virtual machine

The first command gets the virtual machine object named VM01, and then stores the object in the $VM variable.

The second command gets the servicing window subscription objects for the virtual machine stored in $VM and stores the objects in the $SvcWindowSub variable.

The last command displays the servicing windows stored in $SvcWindowSub.

PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> $SvcWindowSub = Get-SCServicingWindowSubscription -VM $VM
PS C:\> $SvcWindowSub

Example 2: Get a list of subscriptions for a specified servicing window

The first command gets the servicing window object named Backup Staging A, and then stores the object in the $SvcWindow variable.

The second command gets the servicing window subscription objects for the servicing window stored in $SvcWindow, and stores the objects in the $SvcWindowSub variable.

The last command displays the list of subscriptions stored in $SvcWindowSub to the user.

PS C:\> $SvcWindow = Get-SCServicingWindow -Name "Backup Staging A"
PS C:\> $SvcWindowSub = Get-SCServicingWindowSubscription -ServicingWindow $SvcWindow
PS C:\> $SvcWindowSub

Example 3: Get the servicing window subscription for a specified virtual machine and a specified servicing window

The first command gets the virtual machine object named VM01, and then stores the object in the $VM variable.

The second command gets the servicing window object named Backup Staging A, and then stores the object in the $SvcWindow variable.

The third command gets the servicing window subscription object for the virtual machine stored in $VM and the servicing window stored in $SvcWindow and stores the object in the $SvcWindowSub variable.

The last command displays information about the servicing window subscription stored in $SvcWindowSub.

PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> $SvcWindow = Get-SCServicingWindow -Name "Backup Staging A"
PS C:\> $SvcWindowSub = Get-SCServicingWindowSubscription -VM $VM -ServicingWindow $SvcWindow
PS C:\> $SvcWindowSub

Add-SCServicingWindowSubscription

Remove-SCServicingWindowSubscription

Get-SCVirtualMachine

Get-SCServicingWindow