Citrix Virtual Apps and Desktops SDK

Get-ProvVM

Gets the VMs created using Machine Creation Services.

Syntax

Get-ProvVM
   [-ProvisioningSchemeUid <Guid>]
   [[-ProvisioningSchemeName] <String>]
   [-VMName <String>]
   [-Locked <Boolean>]
   [-Tag <String>]
   [-OutOfDate]
   [-ReturnTotalRecordCount]
   [-MaxRecordCount <Int32>]
   [-Skip <Int32>]
   [-SortBy <String>]
   [-Filter <String>]
   [-FilterScope <Guid>]
   [<CitrixCommonParameters>]
   [<CommonParameters>]
<!--NeedCopy-->

Description

Provides the ability to obtain a list of the VMs that were created using Citrix Machine Creation Services.

Examples

EXAMPLE 1

Gets all the Virtual Machines that were provisioned using the Provisioning Scheme called ‘MyScheme’.

Get-ProvVM -provisioningSchemeName MyScheme

ADAccountName                     : MYDomain\computer2$
ADAccountSid                      : S-1-5-21-3751941309-1176885247-1409628468-3179
CpuCount                          : 1
CreationDate                      : 17/05/2021 09:35:22
Domain                            : steve.dum.local
ImageOutOfDate                    : False
Lock                              : True
MemoryMB                          : 512
ProvisioningSchemeName            : XenPS
ProvisioningSchemeUid             : 5135a865-ba49-4e5f-87f2-2d65ee7a4e51
ProvisioningSchemeUpdateRequested : 17/05/2021 09:39:03
ProvisioningSchemeVersion         : 1
Tag                               : Brokered
VMId                              : a830de93-ddc5-b763-dc1a-35580a31401c
VMName                            : IP0051
AssignedImage                     : 57fc60c3-eb9b-4d38-8646-0afceec85335
BootedImage                       : 57fc60c3-eb9b-4d38-8646-0afceec85335
HostingUnitUid                    : ea17840f-cf2d-4d80-94e0-3b752b32e0af
HypervisorConnectionUid           : 99f9f826-31fc-4453-8ca0-9ba54306c3ac
IdentityDiskIndex                 : 1
LastBootTime                      : 17/05/2021 09:35:22
OSDiskIndex                       : 0
PersonalVDiskIndex                : -2147483648
PersonalVDiskStorage              :
StorageId                         : 33ad07a7-edd7-589b-716a-86cad4739f5e
NetworkMaps                       : {0}
IdentityDiskId                    : MCS-IdentityDisk-0001
IdentityDiskStorage               : {XDHyp:\Connections\XDHost\Local-Storage-For-Identity-Disk.Storage}
PersonalVDiskId                   :
SecurityGroups                    : {}
AdditionalStorage                 : {}
WriteBackCacheMemorySize          : 0
UseFullDiskCloneProvisioning      : False
CustomVmData                      :
WorkgroupMachine                  : False
WindowsActivationStatus           : Errored
WindowsActivationTypeProvisionedVirtualMachine : MultipleActivationKey
WindowsActivationStatusErrorCode  : KeyLimitExceeded
WindowsActivationStatusError      : Windows activation failed because the maximum number of activations have been exceeded for the specified activation key
<!--NeedCopy-->

EXAMPLE 2

Gets all the Virtual Machines that were locked, regardless of which Provisioning Scheme the VM was created with.

Get-ProvVM -Locked $true

ADAccountName                     : MYDomain\computer1$
ADAccountSid                      : S-1-5-21-3751941309-1176885247-1409628468-3178
CpuCount                          : 1
CreationDate                      : 17/05/2021 09:35:30
Domain                            : steve.dum.local
ImageOutOfDate                    : False
Lock                              : True
MemoryMB                          : 512
ProvisioningSchemeName            : XenPS
ProvisioningSchemeUid             : 5135a865-ba49-4e5f-87f2-2d65ee7a4e51
ProvisioningSchemeUpdateRequested : 17/05/2021 09:39:03
ProvisioningSchemeVersion         : 1
Tag                               : Brokered
VMId                              : a830de93-ddc5-b763-dc1a-35580a31401c
VMName                            : IP0051
AssignedImage                     : 57fc60c3-eb9b-4d38-8646-0afceec85335
BootedImage                       : 57fc60c3-eb9b-4d38-8646-0afceec85335
HostingUnitUid                    : ea17840f-cf2d-4d80-94e0-3b752b32e0af
HypervisorConnectionUid           : 99f9f826-31fc-4453-8ca0-9ba54306c3ac
IdentityDiskIndex                 : 1
LastBootTime                      : 17/05/2021 09:35:22
OSDiskIndex                       : 0
PersonalVDiskIndex                : -2147483648
PersonalVDiskStorage              :
StorageId                         : 33ad07a7-edd7-589b-716a-86cad4739f5e
NetworkMaps                       : {0}
IdentityDiskId                    : MCS-IdentityDisk-0001
IdentityDiskStorage               : {XDHyp:\Connections\XDHost\Local-Storage-For-Identity-Disk.Storage}
PersonalVDiskId                   :
SecurityGroups                    : {}
AdditionalStorage                 : {}
WriteBackCacheMemorySize          : 0
UseFullDiskCloneProvisioning      : False
CustomVmData                      :
WorkgroupMachine                  : False
WindowsActivationStatus           : Errored
WindowsActivationTypeProvisionedVirtualMachine : MultipleActivationKey
WindowsActivationStatusErrorCode  : KeyLimitExceeded
WindowsActivationStatusError      : Windows activation failed because the maximum number of activations have been exceeded for the specified activation key
<!--NeedCopy-->

Parameters

-ProvisioningSchemeUid

The unique identifier of the provisioning scheme.

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

-VMName

The name of the VM in the hypervisor.

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

-Locked

Indicates whether only VMs that are marked as locked are returned or not (see Lock-ProvVM and Unlock-ProvVM for details).

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

-Tag

The tag string that was associated with the VM when it was locked.

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

-OutOfDate

Indicates that the image currently assigned to the VM is out of date. The image will be updated the next time the VM is restarted.

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

-ReturnTotalRecordCount

See about_Prov_Filtering for details.

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

-MaxRecordCount

See about_Prov_Filtering for details.

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

-Skip

See about_Prov_Filtering for details.

Type: Int32
Position: Named
Default value: 0
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-SortBy

See about_Prov_Filtering for details.

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

-Filter

See about_Prov_Filtering for details.

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

-FilterScope

Gets only results allowed by the specified scope id.

Type: Guid
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False
Introduced in: Citrix Virtual Apps and Desktop 7 2106

-ProvisioningSchemeName

The name of the provisioning scheme.

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

CitrixCommonParameters

This cmdlet supports the common Citrix parameters: -AdminAddress, -AdminClientIP, -BearerToken, -TraceParent, -TraceState and -VirtualSiteId. For more information, see about_CitrixCommonParameters.

CommonParameters

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

Inputs

None

You can’t pipe objects to this cmdlet.

Outputs

Citrix.MachineCreation.Sdk.ProvisionedVirtualMachine

The object has the following properties:

ADAccountSid <string>

The SID of the AD computer account that the VM is using.

ADAccountName <string>

The name of the AD computer account that the VM is using.

CpuCount <int>

The number of processors allocated to the VM.

CreationDate <DateTime>

The date and time when the VM was created.

CurrentSnapshotName <string>

The name of the provisioned snapshot closest to the state of the VM.

Domain <string>

The Domain of the AD computer account that the VM is using.

ImageOutOfDate <bool>

Indicates if the image will be updated next time the VM is started.

Lock <bool>

Indicates whether the VM is locked or not.

MemoryMB <int>

The maximum amount of memory allocated to the VM.

ProvisioningSchemeName <string>

The name of the provisioning scheme associated with the VM.

ProvisioningSchemeUid <Guid>

The unique identifier of the provisioning scheme associated with the VM.

PropertyUpdateWindowStart <DateTime>

Defines the start of the time window wherein if the VM is booted, it will be updated to the latest provisioning scheme and personalization settings.

PropertyUpdateWindowEnd <DateTime>

Defines the end of the time window wherein if the VM is booted, it will be updated to the latest provisioning scheme and personalization settings.

ProvisioningSchemeVersion <int>

The version of the provisioning scheme currently used by this VM.

ProvVMConfigurationVersion <int>

The version of the custom configuration currently used by this VM.

Tag <string>

Provides the string associated with a locked VM.

VMId <string>

The identifier for the VM in the hypervisor.

VMName <string>

The name of the VM in the hypervisor.

AssignedImage <string>

The identifier (in the hypervisor) for the hard disk image that the VM is currently assigned.

BootedImage <string>

The identifier (in the hypervisor) for the hard disk image with which the VM is currently started.

HostingUnitUid <Guid>

The unique identifier of the hosting unit that was used to create the VM.

HypervisorConnectionUid <Guid>

The unique identifier of the hypervisor connection that was used to create the VM.

IdentityDiskIndex <int>

The disk index on which the identity disk is attached.

LastBootTime <DateTime>

The date and time of the last start of the VM.

OSDiskIndex <int>

The disk index on which the hard disk image, from which the VM is currently started, is attached. It is set to [int]::MinValue for VMs inherited from versions of XenDesktop 5.6 or earlier.

PersonalVDiskIndex <int>

The disk index on which the personal vdisk is attached. Defaults to [int]::MinValue for VMs without a personal vDisk.

PersonalVDiskStorage <string>

The identifier (in the hypervisor) for the storage on which the personal vDisk image attached to the VM is located. This is set only if the VM has a personal vDisk attached.

StorageId <string>

The identifier (in the hypervisor) for the storage on which the hard disk image, from which the VM is currently started, is located.

NetworkMaps <Citrix.MachineCreation.Sdk.NetworkMap[]>

The NIC/network mappings Used to create the VM.

IdentityDiskId <string>

The identifier (in the hypervisor) for the identity disk attached to the VM.

IdentityDiskStorage <string>

The identifier (in the hypervisor) for the storage on which the identity disk image from which the VM is currently started is located.

PersonalVDiskId <string>

The identifier (in the hypervisor) for the personal vDisk attached to the VM. This is set only if the VM has a personal vDisk attached.

SecurityGroups <string[]>

The security groups that has been applied to the VM. This only applies in a Cloud provisioning context.

AdditionalStorage <System.Collections.Generic.Dictionary[string, AdditionalStorageDiskImage]>

Additional storage disk images attached to this VM keyed by their storage tier names.

WriteBackCacheMemorySize <int>

The size of the write-back memory cache if specified in MB.

UseFullDiskCloneProvisioning <bool>

Indicates if the VM was created using the dedicated full disk clone feature.

CustomVmData <string>

Hypervisor specific custom data packet that has been associated with the virtual machine if any.

WorkgroupMachine <bool>

Indicates if the VM is joined to a workgroup.

WindowsActivationType <string>

Windows Activation Type of the Provisioned Virtual Machine. The default value is unknown and the field is populated once the virtual machine registers with DDC. This is supported only on 2303 and successive versions.

WindowsActivationStatus <string>

Windows Activation Status of the provisioned virtual machine. This is by default set to unknown and is updated when the vda registers with the DDC. The updated values can be Active:The virtual machine is licensed and activated, Inactive:The virtual machine is unlicensed, Errored:An error occured while trying to activate the system.

WindowsActivationStatusErrorCode <string>

The default value is Unknown. If successful, it displays as Success, else it displays with the associated error code.

WindowsActivationStatusVirtualMachineError <string>

Provides a detailed information of potential error message seen while activating the windows system

Notes

In the case of failure, the following errors can result.

Error Codes


PartialData

Only a subset of the available data was returned.

CouldNotQueryDatabase

The query required to get the database was not defined.

PermissionDenied

The user does not have administrative rights to perform this operation.

ConfigurationLoggingError

The operation could not be performed because of a configuration logging error

CommunicationError

An error occurred while communicating with the service.

DatabaseNotConfigured

The operation could not be completed because the database for the service is not configured.

InvalidFilter

A filtering expression was supplied that could not be interpreted for this cmdlet.

ExceptionThrown

An unexpected error occurred. For more details, see the Windows event logs on the controller being used or Citrix Virtual Apps and Desktops logs.

Get-ProvVM