Automation

 View Only
  • 1.  Help with 2 simple scripts

    Posted Aug 09, 2011 01:49 PM

    I am looking for 2 very simple scripts, one is for a specific cluster 1, i want to list all VM's which have 4gb of memory or more.

    Then a 2nd script for a specific cluster1, want to list VM's which dont have VM tools installed or are out of date and want to select the name, vmware tool status and the the memory.

    Can anyone assist please



  • 2.  RE: Help with 2 simple scripts

    Posted Aug 09, 2011 02:46 PM

    Is that for ESX or ESXi?

    Are you looking for a powershell script or a shell script?

    Jonathan



  • 3.  RE: Help with 2 simple scripts

    Posted Aug 09, 2011 02:53 PM

    powershell script.

    thanks



  • 4.  RE: Help with 2 simple scripts
    Best Answer

    Posted Aug 09, 2011 03:16 PM

    here is a one line that I tried on a single host...and should work if you log on a VC as well... it will list all the VMs that have more than 4GB of memory :

    Get-VM | Where-Object {$_.MemoryMB -gt 4096}

    If you want just the name and memory then :

    Get-VM | Where-Object {$_.MemoryMB -gt 4096} | Select Name,MemoryMB

    For the other for the VMtools...

    Get-VM | Get-View | Select-Object @{N="Name";E={$_.Name}},@{Name="ToolsStatus";E={$_.Guest.ToolsStatus}}

    Regards