Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 228891

Re: vm query script help

$
0
0

Try something like this

 

foreach($dsin (Get-Cluster|
               
where($_.Name-notlike"*lab*"} |
               
Get-VMHost|Get-Datastore|
               
where {$_.Name-notlike"*ISO*"-and$_.Name-notlike"*templates*"})){
 
Get-VM-Datastore$ds|
 
where {(Get-NetworkAdapter-VM $_|Select-ExpandPropertyNetworkName) -ne"Backup Network"}
 
SelectName,
   
@{N="Datastore";E={$ds.Name}},
   
@{N="BackedUp";E={Get-Annotation-Entity$_-Name"NameOfTheAttribute"|Select-ExpandPropertyValue}}
}

You have to use the proper custom attribute name in place of the "NameOfTheAttribute" I used


Viewing all articles
Browse latest Browse all 228891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>