VMware Cloud Community

List users who have not logged in x number of days

Hi, I would appreciate any help on this one. I'd like to create a query and report of Users in vCenter who have not logged in to vCenter in over X number of days, assuming they have a permission configured in vCenter in the first place. Is this possible, would I need to create an array of all the names with permission first, and then query that against the days they have logged in?

Any help would be great thanks



Tags (1)
0 Kudos
1 Reply

You can use the UserLoginSessionEvent event to track who logged in with Get-VIEvent.
But it depends on how long you keep events in your vCenter.

You can get users with the Get-VIAccount cmdlet.
But be aware the permissions can also be given to groups, meaning you will have to query which users actually belong to that group.
Also, some groups receive permissions automatically, for example, the AD Administrators group when the vCenter is joined to an AD domain.

It will be rather complex to find all users that have a permission to connect to a vCenter

Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference