Automation

 View Only
  • 1.  Windows Server Logical Disk Free Space via VM Tools

    Posted Mar 10, 2010 02:20 PM

    I am looking for a way to script a report in powershell to tell me the free disk space of the logical drives without having any kind of administrator rights on the virtual windows server. Is there a way to obtain this information via the VM Tools and have it report it to vCenter where I can obtain this information and add it to my report.

    I have found some information from other resources but they use a WMI query which I would have to connect to the server with administrator rights in order to get this information.



  • 2.  RE: Windows Server Logical Disk Free Space via VM Tools

    Posted Mar 10, 2010 02:37 PM

    The next script uses the VMware Tools to get the guests disk information:

    Get-VM | `
      Where-Object { $_.PowerState -eq "PoweredOn" } | `
      Get-VMGuest | `
      ForEach-Object {
        $VmName =$_.VmName
        If ($_.Disks) { $_.Disks | `
          Add-Member -membertype NoteProperty -name VmName -Value $VmName -Passthru
        }
      }

    Robert