Need information how bigfix retreives the logged on user detail

Hi team,

i am curious to know how bigfix retrieves the detail of the logged on user. Where from the user detail is being getting fetched when we run the following command.

names of logged on users

Further more, is there any powershell equivalnet of the sam command?

If you checkout this link it gives reference to where it’s getting the data for those inspectors.

logged on user | BigFix Developer

The biggest challenge I have seen with trying to get the currently logged on user comes when there is more than one user who use the device and trying to report on it after the fact.

With PowerShell you should consider the context that the script is running under as well as where your pulling the data from. If you are running the script as system instead of the user it likely won’t identify the user correctly. If that is the case you may need to lookup the user name in registry as system or run the powershell script in user context using override wait and runas=currentuser.
If you use runas=currentuser you could pull it from the username value under Volatile Environment under the current user registry hive or there are a few other ways that you could pull it.

[System.Security.Principal.WindowsIdentity]::GetCurrent().Name
or
$env:username
or
[Environment]::UserName

Whoami through command line is also an option if running it as the user.