Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

A brief introduction to what I consider to be the best editor for PowerShell.
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
Teach the user how to use configure the vCenter Server storage filters Open vSphere Web Client:  Navigate to vCenter Server Advanced Settings: Add the four vCenter Server storage filters: Review the advanced settings: Modify the values of the four v…
Advanced tutorial on how to run the esxtop command to capture a batch file in csv format in order to export the file and use it for performance analysis. He demonstrates how to download the file using a vSphere web client (or vSphere client) and exp…

791 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