Guys,
I am not sure if I have found the correct forum or not. But I am struggling to get a report to show me "VmClonedEvent" outputs. I am using the below script as part of the vcheck and all other creation events show results except for any cloned VM's which make up 95% of all new VM's in our environment. Does anyone have any ideas what might be happening here?
# Start of Settings
# Set the number of days to show VMs created for
$VMsNewRemovedAge =30
# End of Settings
$VIEvent = Get-VIEvent -maxsamples 10000 -Start ($Date).AddDays(-$VMsNewRemovedAge)
$OutputCreatedVMs = @($VIEvent | where {$_.Gettype().Name -eq "VmBeingCreatedEvent" -or $_.Gettype().Name -eq "VmClonedEvent" -or $_.Gettype().Name -eq "VmBeingDeployedEvent"} | Select createdTime, UserName, fullFormattedMessage)
$OutputCreatedVMs
$Title = "Created or cloned VMs"
$Header = "VMs Created or Cloned (Last $VMsNewRemovedAge Day(s)): $(@($OutputCreatedVMs).count)"
$Comments = "The following VMs have been created over the last $($VMsNewRemovedAge) Days"
$Display = "Table"
$Author = "Alan Renouf"
$PluginVersion = 1.1
$PluginCategory = "vSphere"