VMware View Reset DesktopVM via Powershell

Problem: Can’t reset multiple VMs at one time via admin portal​ page based on session duration. View PowerCLI snippt to reset non responding machines what are stuck in disconnected state for more than a 24 hrs [code language=”powershell”] Get-RemoteSession -State Disconnected | ? {$_.duration -like "*day*"} | % {Get-DesktopVM -Name $_.DNSName.Split(".")[0] | Send-VMReset} [/code] View …

vSphere Export VMName and MacAddress

Get VMs begining with DC2-GEN-V62 and use Get-NetworkAdapter for MAC address with powershell expression [code language=”powershell”] connect-viserver vsphere01 get-vm DC2-GEN-V62* | Select @{Expression={$_.Name};Label="VM Name"},@{Expression={$(Get-NetworkAdapter -VM $_.Name).MacAddress};Label="Mac Address"} | Export-csv c:\tmp\DC2-GEN-V62_MACs.csv [/code] Just display with out export to CSV [code language=”powershell”] connect-viserver vsphere01 get-vm DC2-GEN-V62* | Select @{Expression={$_.Name};Label="VM Name"},@{Expression={$(Get-NetworkAdapter -VM $_.Name).MacAddress};Label="Mac Address"} [/code]

WordPress Appliance - Powered by TurnKey Linux