PowerCLI: Report every VM added to vCenter in the last 30 days

From VI-Toolkit
Revision as of 10:05, 12 May 2009 by Wila (talk | contribs) (New page: At seemingly random intervals I get requests from management to report every Virtual Machine that was added/removed in the last x days. This has traditionally been a manual process, and on...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

At seemingly random intervals I get requests from management to report every Virtual Machine that was added/removed in the last x days. This has traditionally been a manual process, and one that I loath.

While deploying a VM this morning I set up my normal tell me when your done one-liner…

Get-Task|?{$_.Name -eq "CloneVM_Task"}|Wait-Task; `a`a`a

As I was typing I wondered how long a task’s history was kept, and if I could query it via the SDK? Low and behold not only can I but it’s too easy!

http://get-admin.com/blog/?p=725