Posted on Leave a comment

Get old events from Vcenter using powerCLI

If there is a reason that you want to retrieve older events from Vcenter than the 1000 that are available, you can use powerCLI in order to get specific date ranges.

After you login in the vCenter using

Connect-VIServer SERVER_IP

you can use Get-VIEvent with Start or Finish attributes. Be careful also to use Maxsamples attribute in order to get more than 10 that are returned by default.

For example if I wanted all events that have been captured the weekend I could use something like:

Get-VIEvent -maxsamples 10000 -start "28/07/2018"

P.S Date is a DateTime and should be used as above

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.