PyVmomi API For Last Logon Time
Hello,
I am using pyVmomi for automation purpose. My aim is to get all VMs along with their last logon time (by any user). I am interested in this last logon time, as I need to auto logout or shutdown all those machines which have logged in since more than x days.
Does the API has support for this feature of getting "last logon time" ? Please help.
Regards, Venu
Hello, Could you please respond on this?
Many thanks. Venu.
Hi Venu,
If below line of code helps you runtime_info = vmObj.runtime.bootTime print("last powered on : ", runtime_info)
Hi Purohit,
The boot time and log on time are different. I am able to fetch the bootTime. I am interested in knowing the last log on time. The use case here is that, people boot the machine, and keep on using it, log in, log out, without powering off. I need to find such machines whose last log on time is > 60 days (The boot time could be much more than this), and take some action on these systems. Is there any such field which exposes the last logon time?
Hello, Can you please update on this?
Regards, Venu
Hi Venu,
There is no field in any of the apis to get the last logon time of VM.
Thanks, Shweta
Any plan to include this feature? Or can you please take this as a new feature request? This is very much needed to solve our problem, as described in the issue.
Regards, Venu
Hello, Can you please update on this ?
Regards, Venu
This demand should be invalidated and close because you ask something that is linked to the OS execution, not to VMWare VSphere. It's just impossible to know when was the last logon time on a VM with VMWare VSphere.