Solved

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

Posted on 2014-01-13
5
2,338 Views
Last Modified: 2014-01-14
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
0
Comment
Question by:Lumious
  • 3
  • 2
5 Comments
 
LVL 13

Expert Comment

by:Abhilash
ID: 39778384
In the last script link I provided you at http://www.experts-exchange.com/Software/VMWare/Q_28337757.html , take of one of the event and replace it with

VmConnectedEvent

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

Author Comment

by:Lumious
ID: 39780159
Hi,

Abhilash Hb:

As discussed here:

http://www.experts-exchange.com/Software/VMWare/Q_28337757.html

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

Thanks
0
 
LVL 13

Expert Comment

by:Abhilash
ID: 39780267
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.
0
 

Author Comment

by:Lumious
ID: 39780286
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
0
 
LVL 13

Accepted Solution

by:
Abhilash earned 500 total points
ID: 39780295
Its very easy that way.
Download this tool called RVtools

Run it against your vCenter. It will generate an extensive report of all the possible things you need. Including Power on event which can be found under vInfo called as PowerOn.

Let me know if that is enough. Also you can export the report into EXcel,CSV  etc.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
Teach the user how to configure vSphere clusters to support the VMware FT feature Open vSphere Web Client: Verify vSphere HA is enabled: Verify netowrking for vMotion and FT Logging is in place or create it: Turn On FT for a virtual machine: Verify …
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now