Skip to content

Commit 0757fc0

Browse files
authored
Update GET-HELP script (#6)
1 parent e19b9ae commit 0757fc0

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

XAXD/VMsInUnknownPowerState/Get-VmInUnknownPowerState.ps1

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,49 @@
1-
Param([string]$HypervisorConnectionName, [string]$BrokerCatalogName, [switch]$Fix)
1+
<#
2+
.SYNOPSIS
3+
Diagnosing and (semi-) automatically resolving VMs on Citrix Virtual Apps and Desktops (CVAD) in an unknown power state.
4+
.DESCRIPTION
5+
Get-ProvVmInUnknownPowerState diagnoses the VMs on CVAD in an unknown power state, reports the causes, and (semi-) automatically fixes the causes.
6+
Specifically, Get-ProvVmInUnknownPowerState utilizes the names of VMs on CVAD to find the corresponding VMs on hypervisors and check three scenarios below that can make the power state of the VMs unknown.
7+
Scenario 1: the state of the hypervisor connection is unavailable. such as connection credentials being invalid.
8+
Scenario 2: the VMs on the hypervisor are deleted.
9+
Scenario 3: the IDs of VMs on CVAD mismatches the corresponding IDs of the VM on hypervisors.
10+
11+
In case of scenario 1 and 2, Get-ProvVmInUnknownPowerState reports the causes of the unknown power state and provide suggestions to help admins fix the issues, such as correcting the credentials or deleting the VMs on CVAD.
12+
In the case of scenario 3, Get-ProvVmInUnknownPowerState reports the causes and suggestions.
13+
If the "-Fix" parameter is specified, Get-ProvVmInUnknownPowerState fixes the causes of scenario 3 automatically.
14+
The scenario 1, 2, and 3 are exclusive. If the connection is unavailable, it is not possible to access the hypervisor; consequently, check whether the corresponding VM on the hypervisor is deleted or the IDs are matched.
15+
.INPUTS
16+
Get-ProvVmInUnknownPowerState can take a hypervisor connection name, a broker catalog name, and/or "-Fix" as input.
17+
.OUTPUTS
18+
1. If either a hypervisor connection name or a broker catalog is given, then Get-ProvVmInUnknownPowerState reports the VMs in an unknown power state associated with the hypervisor connection name or the broker catalog.
19+
2. If both a hypervisor connection name and a broker catalog are given, then Get-ProvVmInUnknownPowerState reports the VMs associated with the broker catalog, because the VMs on the catalog is a subset of the VMs on the hypervisor connection
20+
3. Without the "-Fix" parameter, the admin can get the report that includes the list of the VMs with the unknown power states together with the causes and suggestions.
21+
4. With the parameter "-Fix", the admin can get the report, and the script automatically resolved the issue of scenario 3 by updating the IDs of VMs.
22+
.PARAMETER HypervisorConnectionName
23+
The name of the hypervisor connection. Report the VMs associated with the hypervisor connection.
24+
.PARAMETER BrokerCatalogName
25+
The name of the broker catalogue name. Report the VMs associated with the catalog.
26+
.PARAMETER Fix
27+
Update the UUIDs of VMs automatically to resolve the mismatched UUID issue.
28+
.NOTES
29+
Version : 1.0.1
30+
Author : Citrix Systems, Inc.
31+
.EXAMPLE
32+
Get-ProvVmInUnknownPowerState
33+
.EXAMPLE
34+
Get-ProvVmInUnknownPowerState -Fix
35+
.EXAMPLE
36+
Get-ProvVmInUnknownPowerState -HypervisorConnectionName "ExampleConnectionName" -Fix
37+
#>
38+
39+
Param(
40+
[Parameter(Mandatory=$false)]
41+
[string]$HypervisorConnectionName,
42+
[Parameter(Mandatory=$false)]
43+
[string]$BrokerCatalogName,
44+
[Parameter(Mandatory=$false)]
45+
[switch]$Fix
46+
)
247

348
# Add XDHyp
449
Add-PSSnapin -Name "Citrix.Broker.Admin.V2","Citrix.Host.Admin.V2"

0 commit comments

Comments
 (0)