Solved

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

Posted on 2014-01-13
5
2,410 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Teach the user how to configure vSphere Replication and how to protect and recover VMs Open vSphere Web Client: Verify vsphere Replication is enabled: Enable vSphere Replication for a virtual machine: Verify replicated VM is created: Recover replica…
Teach the user how to join ESXi hosts to Active Directory domains Open vSphere Client: Join ESXi host to AD domain: Verify ESXi computer account in AD: Configure permissions for domain user in ESXi: Test domain user login to ESXi host:

896 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

17 Experts available now in Live!

Get 1:1 Help Now