Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 232869

Re: Who Built the vm

$
0
0

In the condition (the Where-clause) you have $_.CreatedTime -lt (Get-Date).adddays(-30), that means you will let events through that are older than 30 days. While in the Get-VIEvent cmdlet you specify to start with events from 10 days ago till now.

Perhaps try running the script without the CreationData condition. Something like this

 

Get-VIEvent-Start (Get-Date).adddays(-10) |
where {$_.gettype().Name-eq"VmCreatedEvent"} |select@{N="VMname";E={$_.Vm.Name}},
   
@{N="CreatedTime";E={$_.CreatedTime}},
    @{N="Host";E={$_.Host.Name}},
    @{N="User";E={$_.UserName}} |
Export-Csv
"C:\VM-vmcreatedevent-audit.csv"-NoTypeInformation-UseCulture

Viewing all articles
Browse latest Browse all 232869

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>