Method

GetPrimaryUser

ModuleUsers
LibraryCore
Action


Get the primary user of a device.


Parameters(None)
Return values

PrimaryUser (string): The name of the primary user of a device.

  • Windows: If historic data is available (requires Inventory module to be enabled) - the user with the longest total logged-on duration over the last 28 days. Without historic data - whoever has been logged-in longest of all the active users.
  • macOS, Linux and Solaris:  If historic data is available - the user with the longest total logged-on duration over the last 28 days. Without historic data - the user with the most number of active sessions.

Active means currently logged on.

Example


Users.GetPrimaryUser();


Platforms
  • Windows
  • Linux
  • MacOS
  • Solaris Intel
  • Solaris Sparc
Notes

Available from v5.1.

More detail about active (currently logged-on) users is available using Users.GetLoggedOnUsers.

For Windows, historic data is also stored in the Tachyon Activity Record: User usage daily table if the Inventory module is enabled.

The 28-day threshold used to analyze historical data is not configurable in this version of Tachyon.