PowerCLI advanced troubleshooting
Script A: Get the list of virtual machines
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:$falseExample use
Script B -:Launching the vmrc
Example use
PreviousEssential information about credential property GUIDs in Remote Desktop ManagerNextPowerShell scripting
Last updated
Was this helpful?