VMware Cloud Community
mlurette
Contributor
Contributor
Jump to solution

How to keep track of who is using what VM?

We have quite a lot of VMs on our esx servers and a lot of people using them. Because of the nature of our work, the majority are left idle "just in case". If we need to shut one down for any reason, we need to open it up in a console and sit and stare at the screen to see if any windows open or if the cursor moves. What I'm looking to do is figure out a way to see what user is using what vm (in other words to see who has what VM open in a console doing/about to do something). 

Any help, links, articles, scripts or hints would be greatly appreciated.

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

If you only want to see who connected to a console of a VM, you could try

Get-VIEvent -Start (Get-Date).AddDays(-7) -MaxSamples ([int]::MaxValue) |

where{$_ -is [VMware.Vim.VmRemoteConsoleConnectedEvent]} |

Select CreatedTime,UserName,@{N='VM';E={$_.Vm.Name}}


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

View solution in original post

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

If you only want to see who connected to a console of a VM, you could try

Get-VIEvent -Start (Get-Date).AddDays(-7) -MaxSamples ([int]::MaxValue) |

where{$_ -is [VMware.Vim.VmRemoteConsoleConnectedEvent]} |

Select CreatedTime,UserName,@{N='VM';E={$_.Vm.Name}}


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

Reply
0 Kudos
mlurette
Contributor
Contributor
Jump to solution

Perfect! Thank you so much! The only thing missing is that it only show who is on a vSphere console. Do you know of any functionality that would also show us users using workstation or fusion?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

I'm afraid not.

I think you better ask that part of the question in the Workstation or Fusion Community.


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

Reply
0 Kudos