Hello
I use the below code to get the User info who has created any VM in the vCenter
It works fine, but today I seen that it was taking very long to generate the report. Then during debugging process I figured out that every time it get struct when trying to pull the logs for one particular VM. ( Take almost 45 min to get the logs for this machine)
And then later I find out that VM's folder name is also same as VM name.
I then changed the VM folder name to something else and run the script again and this time No issues.
How can we avoid this issue ? can anyone suggest anything ?
$Vm_Event = Get-VIEvent -Entity $VM_Name -Start $start -Finish $end -Types info `
|Where-Object {$_.GetType().Name -eq "VmClonedEvent" -or $_.GetType().Name -eq "VmDeployedEvent" `
-or $_.GetType().Name -eq "VmRegisteredEvent" -or $_.GetType().Name -eq "VmcreatedEvent"}