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

Re: VIObject error message

$
0
0

Not 100% sure that I understood what you were trying to do, but I suspect it was to get the path to the standalone ESXi.

Try it like this

 

####################
write-host"Standalone hosts:"-foregroundcolorgreen
#TM hosts not in cluster
$hostlist=Get-VMHost|where{$_.ExtensionData.Parent.Type-ne"ClusterComputeResource"}
foreach ($host1in$hostlist) {
 
#get folder
  $path=@($host1.Name)
 
$parent=Get-View$host1.ExtensionData.Parent
 
While ($parent.parent){
   
$parent=Get-View$parent.parent
   
if("Datacenters","host"-notcontains$parent.Name){
     
$path+=$parent.Name
    }
  }
  [
array]::Reverse($path)
 
$path= [string]::Join('/',$path)
 
write-host"$path"


  
$out=get-vmhost$host1|get-vmhosthba|get-scsilun|get-scsilunpath|
 
Select-ExpandPropertySanID-unique-ErrorAction"SilentlyContinue"


 
write-host"$out"
 
write-host" "
}
####################

Viewing all articles
Browse latest Browse all 236824

Trending Articles



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