VMware Cloud Community
imcooltanmay
Enthusiast
Enthusiast
Jump to solution

PowerCLI script to find disconnected and connected VM's?

how to find  disconnected and connected VM's?

Tags (1)
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try with this.
It should say 'disconnected' or 'inaccessible' for those VMs

Get-VM | select name, @{N = 'ConnectionState'; E = { $_.ExtensionData.Runtime.ConnectionState } }


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

4 Replies
LucD
Leadership
Leadership
Jump to solution

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

imcooltanmay
Enthusiast
Enthusiast
Jump to solution

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

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Try with this.
It should say 'disconnected' or 'inaccessible' for those VMs

Get-VM | select name, @{N = 'ConnectionState'; E = { $_.ExtensionData.Runtime.ConnectionState } }


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

imcooltanmay
Enthusiast
Enthusiast
Jump to solution

Thank you @LucD

0 Kudos