Is it possible to get the currently logged in user on a machine. I know that you can get it via wscriptwitht he following code:
Function QPO
On Error Resume next
strLookFor = "Kbyrum"
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'explorer.exe'")
For Each objProcess in colProcessList
objProcess.GetOwner strUserName, strUserDomain
'WScript.StdOut.Write strInput
Wscript.stdout.write strComputer &",Is logged into by "&strUserDomain & "\" & strUserName &","&time
if strUserName = strLookfor then
Wscript.echo strUserName & "is logged into " & strComputer
end if
Next
End Function