Hi, Averyone
I must script for check current user logon guest os (VMs) with display list VMs and name user logon
How can I check that, So Whom have script for list state & current user logon
Thanks.
No. VIX doesn't have any API that will give the information about the current logged in user.
There is a workaround. Follow these steps.
- Execute VixVM_ListProcessesInGuest(). This api lists down the information (owner, process id, command name, etc) about all the running processes in the guest.
- From the list, check for processes which have 'vmtoolsd' and 'vmusr' in the command name.
- Get the owner of the matching processes.
This gives the information about the currently logged in user.
You can use 'vmrun' (command line utility bundled with VMware VIX API) to list the processes running in the guest. Use your favorite grep utility to search in the 'vmrun' output.
Ex:
Check the owner. The currently logged in user is guestadmin. ![]()
