Hi All,
Is there a means of identifying all the users that have logged into the vCenter over the past x days (preferably 30). Our organisation is having a cleanup in AD and what the reassurance that certain accounts can be deleted with concern.
Something like this ?
Get-VIEvent -Start (Get-Date).AddDays(-30) -MaxSamples ([int]::MaxValue) |
where{$_ -is [VMware.Vim.UserLoginSessionEvent]} |
Select UserName,IpAddress,CreatedTime
or if you only need the users
Get-VIEvent -Start (Get-Date).AddDays(-30) -MaxSamples ([int]::MaxValue) |
where{$_ -is [VMware.Vim.UserLoginSessionEvent]} |
Group-Object -Property UserName | Select Name
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Something like this ?
Get-VIEvent -Start (Get-Date).AddDays(-30) -MaxSamples ([int]::MaxValue) |
where{$_ -is [VMware.Vim.UserLoginSessionEvent]} |
Select UserName,IpAddress,CreatedTime
or if you only need the users
Get-VIEvent -Start (Get-Date).AddDays(-30) -MaxSamples ([int]::MaxValue) |
where{$_ -is [VMware.Vim.UserLoginSessionEvent]} |
Group-Object -Property UserName | Select Name
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I sincerely hope you don't get run over by a bus one day mate, I think we would all be screwed.
Much appreciated as always