?
Solved

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

Posted on 2014-01-13
5
Medium Priority
?
2,823 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
[X]
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
  • 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 2000 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

This article outlines why you need to choose a backup solution that protects your entire environment – including your VMware ESXi and Microsoft Hyper-V virtualization hosts – not just your virtual machines.
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
Teach the user how to convert virtaul disk file formats and how to rename virtual machine files on datastores. Open vSphere Web Client: Review VM disk settings: Migrate VM to new datastore with a thick provisioned (lazy zeroed) disk format: Rename a…
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…
Suggested Courses

752 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