да, наверное, но он истекает - можешь прямо сюда ps1 с описанием
# Small function to get list of logged-on users and information about their sessions.
# No magic, just Win32_LoggedOnUser wmi class and its related classes are used, and transformed to single object for ease of use in the PowerShell.
# Computer sessions (name ends with $) and DWM (Desktop Window Manager) sessions are excluded, because they dont have related Win32_Account and/or Win32_LogonSession classes. CIM cmdlets are not used because base CIM classes they lack most of the interesting info.
# (c) Vasily Gusev, 2020