For the complete documentation index, see llms.txt. This page is also available as Markdown.

PowerCLI advanced troubleshooting

Remote Desktop Manager calls PowerCLI's cmdlets and presents the results in its user interface.

Here are steps to help isolate issues when the integration is not working as expected.

Script A: Get the list of virtual machines

GETVMS.PS1

Param(
    [Parameter(Mandatory=$true)]
    [string]$viServer,
    [Parameter(Mandatory=$true)]
    [string]$userName,
    [Parameter(Mandatory=$true)]
    [string]$password
) #end param

$VMHost = Connect-VIServer $($viServer) -User $userName -Password $password
if ($VMHost -eq $null ) { throw "Connection to server failed!";}
try
{
    Get-View -ViewType VirtualMachine |  select -Property Name, {$_.Moref.Value};
}
catch
{
    write-host $ErrorMessage
}
Disconnect-VIServer $VMHost -Force -Confirm:$false

Example use

.\GetVMs.ps1 [SERVER_NAME] [USER_NAME] [PASSWORD]

Name $_.Moref.Value ---- -------------- MACHINE1 18 MACHINE2 19

Script B -:Launching the vmrc

CONNECTVMRCFROMPOWERCLI.PS1

Example use

You must send the MoRef.Value which was obtained using Script A, in our example, start MACHINE2 which has 19 for ID.

The VMRC should appear and allow you to interact with it.

Last updated

Was this helpful?