Try with this.
It should say 'disconnected' or 'inaccessible' for those VMs
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
What do you mean with "disconnected and connected VM's"?
Are disconnected VM's those that are not registered anymore?
So-called orphaned VM's?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
For example : if esxi is not responding then vm will be in disconnected State. I am trying to finding out connected and disconnected state of vm
Try with this.
It should say 'disconnected' or 'inaccessible' for those VMs
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you @LucD