1 2 3 Previous Next 62 Replies Latest reply on Mar 2, 2018 3:05 PM by TheCrazyConsultant

    List VMs in datastore that is not in inventory

    MHegelund Novice

      Hi Guys

       

      PowerCLI rookie here, so sorry for stupid questions.

       

      I’m trying to clean up a bunch of singehost with local datastores. So I need a script that can output a list of virtual machine files on a datastore that is not being used by VMs in the inventory. One of the problem is that the files on the datastore, is not all ways named exactly the same as the VM’s in the inventory.

       

      Been looking at this, but I think the term “orphaned” is ‘sent what I think it is:

      https://communities.vmware.com/thread/266913

       

      Also there is this one, which I think I should be able to modify to do what I want:

      http://www.wooditwork.com/2011/08/11/adding-vmx-files-to-vcenter-inventory-with-powercli-gets-even-easier/

       

      Any hints or clues to push me in the right direction would be appreciated.

        1 2 3 Previous Next