Hello,
Is there a way to retrieve current Windows 10 logged in user (Not the enrollment user), Windows 10 Devices are shared between employees and we need to tell who is currently logged to the device.
Thanks in advance
We had the same requirements before, and I was able to get the logged-in user using a sensor like the one below.
$ActiveSession = (quser | Where-Object {$_ -match 'Active'}).Remove(0, 1)
$ActiveUser = ($ActiveSession -split ' +')[0]
write-output $ActiveUser
Or
$User = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
Write-Output $User
Thanks all, the deployment is on-prem, Sensor is not available.
Is there a way to push it to console so it can be seen from CN rather than intelligence reports?