Freigeben über


Get-SCServicingWindowSubscription

Gets a list of servicing window subscriptions.

Syntax

Get-SCServicingWindowSubscription
   [-VMMServer <ServerConnection>]
   [[-ServicingWindow] <ServicingWindow>]
   [<CommonParameters>]
Get-SCServicingWindowSubscription
   [-VMMServer <ServerConnection>]
   [[-ServicingWindow] <ServicingWindow>]
   -VM <VM>
   [<CommonParameters>]
Get-SCServicingWindowSubscription
   [-VMMServer <ServerConnection>]
   [[-ServicingWindow] <ServicingWindow>]
   -VMHost <Host>
   [<CommonParameters>]
Get-SCServicingWindowSubscription
   [-VMMServer <ServerConnection>]
   [[-ServicingWindow] <ServicingWindow>]
   -Service <Service>
   [<CommonParameters>]

Description

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

Examples

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

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

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

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

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

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

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

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

The second command gets the servicing window subscription objects for the servicing window stored in $SvcWindow (Backup Staging A) and stores the objects in the $SvcWindowSub variable.

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

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

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

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

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

The third command gets the servicing window subscription object for the virtual machine stored in $VM (VM01) and the servicing window stored in $SvcWindow (Backup Staging A) and stores the object in the $SvcWindowSub variable.

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

Parameters

-Service

Specifies a Virtual Machine Manager (VMM) service object.

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

-ServicingWindow

Specifies a servicing window object.

Type:ServicingWindow
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-VM

Specifies a virtual machine object.

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

-VMHost

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, see the Add-SCVMHost cmdlet.

Type:Host
Position:Named
Default value:None
Required:True
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

ServicingWindowSubscription

This cmdlet returns a ServicingWindowSubscription object.