Solved

VMware vSphere - PowerCLI Script - Export List of VM Creation Date

Posted on 2014-01-13
10
8,696 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 their creation date was.

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
  • 5
  • 4
10 Comments
 
LVL 13

Expert Comment

by:Abhilash
ID: 39778363
This should help you with that
http://psvmware.wordpress.com/2012/11/27/when-was-vm-created-how-vm-was-created-and-who-has-created-this-vm/#more-726
There is a lot of explaination too with the scripts.
0
 
LVL 11

Expert Comment

by:Manjunath Sullad
ID: 39778875
0
 

Author Comment

by:Lumious
ID: 39779223
Hi,

Abhilash Hb:
- When I try to run the first script they presented, it doesn't do anything in my PowerCLI connection to vCenter 5.1.  I even try to put the script in a Test.ps1 file and run that file from PowerCLI but it doesn't do anything from what I see.  When trying to run the first script they presented, I copied and  pasted the whole thing into the PowerCLI.

Please let me know if I'm running this incorrectly.

Thanks
0
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.

 
LVL 13

Expert Comment

by:Abhilash
ID: 39779234
First you will have to load the functions. That's where the tasks the scripts do are defined.
0
 

Author Comment

by:Lumious
ID: 39779304
Hi,

I'm not sure if I'm running it correctly.  Please see attached document I created for what I actually do and let me know when you can if I'm doing it correctly and if I should continue.

Thanks
Instructions.docx
0
 
LVL 13

Accepted Solution

by:
Abhilash earned 500 total points
ID: 39779655
To load the functions copy paste the whole function and press enter twice till the pointer returns back to normal.

Then try running Get-VM <VM-Name> | Get-VMCreationDate
0
 

Author Comment

by:Lumious
ID: 39780037
Hi,

Your instructions worked!  See attached:

So I ran this on One VM, what if I need to run this on multiple VM's?  I dont want to have to type out each VM Name individually.  Is there a way to make it so that it runs againsts All VMs in the environment and then exports the results to an excel sheet?



Thanks
1-14-2014-1-35-20-PM.jpg
0
 
LVL 13

Assisted Solution

by:Abhilash
Abhilash earned 500 total points
ID: 39780081
Try this

Get-VM | Get-VMCreationDate | Export-Csv -path “c:\reports\vmcreationinventory.csv” -NoTypeInformation.

No too sure but let me know if it works.
0
 

Author Comment

by:Lumious
ID: 39780125
Hi,

That worked!  See attached:

I believe you replied on the other question I posted as well:

http://www.experts-exchange.com/Software/VMWare/Q_28337760.html?anchor=a39778384

Please let me know just like this one, what I would have to replace as it wasn't that clear and I'm not a scripter.

Thanks
1-14-2014-1-57-59-PM.jpg
0
 
LVL 13

Expert Comment

by:Abhilash
ID: 39780140
Nice! Glad to know it worked.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

If we need to check who deleted a Virtual Machine from our vCenter. Looking this task in logs can be painful and spend lot of time, so the best way to check this is in the vCenter DB. Just connect to vCenter DB(default DB should be VCDB and using…
This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
Teach the user how to install and configure the vCenter Orchestrator virtual appliance Open vSphere Web Client: Deploy vCenter Orchestrator virtual appliance OVA file: Verify vCenter Orchestrator virtual appliance boots successfully: Connect to the …
Teach the user how to use create log bundles for vCenter Server or ESXi hosts Open vSphere Web Client: Generate vCenter Server and ESXi host log bundle:  Open vCenter Server Appliance Web Management interface and generate log bundle: Open vCenter Se…

821 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