So I am writing a PowerShell script to pick up some info from domain machines and one of the things that I want to correlate with is logged on user. In theory that is
(Get-WmiObject -ComputerName $CompName -ClassName Win32_ComputerSystem).username
...and it works just fine for locally logged in users. HOWEVER, it returns null for an RDP logged in user and I can't find any other way to get that information.
Has anyone got a clue how to get that info for an RDP logged in User?
This is all Active Directory 2016 with Win 10 1909 or later clients