Hi, I want the list of all the VMs that have a userid called "xyz" in initiated by section. I know, we can get this with get-vievent cmdlet but now sure, how I can use it ? any help will be greatly appreciated.
If the list shows the VMs that don't have that userid, that will also do
Thanks
You mean something like this ?
Get-VIEvent -Start (Get-Date).AddDays(-1) -MaxSamples ([int]::MaxValue) |
Select CreatedTime,
@{N="Type";E={$_.GetType().Name}},
@{N="VM";E={$_.Vm.Name}},
@{N="User";E={$_.UserName}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Actually, this is giving me the data and time. Which I don't need.
I am looking for one particular user in each and every VM. And that user name will only be under "initiated by" column, under tasks and events.
I need the VM name and in next column that username.
Thanks for your help !!!
I see, something like this ?
$userName = "user"
Get-VIEvent -Start (Get-Date).AddDays(-1) -MaxSamples ([int]::MaxValue) | where {$_.UserName -eq $userName} |
Select @{N="VM";E={$_.Vm.Name}}, @{N="User";E={$_.UserName}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
