Link to home
Start Free TrialLog in
Avatar of Lumious
LumiousFlag for United States of America

asked on

VMware vSphere - PowerCLI Script - Export List of VM Name and Last Logon

Hi,

I'm trying to find a PowerCLI script that I can run on my vCenter environment to get a list of all the VM's and when it was last logged into and by whom if possible.

I'm not that good at scripting so if someone could provide the code and explain what I would have to input to get this done that would be great.


Thanks
Avatar of Abhilash
Abhilash

In the last script link I provided you at https://www.experts-exchange.com/questions/28337757/VMware-vSphere-PowerCLI-Script-Export-List-of-VM-Creation-Date.html , take of one of the event and replace it with

VmConnectedEvent

That will get you the last logon information of all VM's
Avatar of Lumious

ASKER

Hi,

Abhilash Hb:

As discussed here:

https://www.experts-exchange.com/questions/28337757/VMware-vSphere-PowerCLI-Script-Export-List-of-VM-Creation-Date.html

Please let me know how to go about this next one.

Thanks
Was just looking at the events. You can only pull the details of the last powered on. I do not see any last logon event.
Avatar of Lumious

ASKER

Hi,

If we are sure that it's not able to find those results, then lets see if we are able to do "last powered on" instead which should be sufficient for the reporting I'm doing.

Please let me know.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Abhilash
Abhilash

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial