Anyone understand why the simple Powershell script below works fine under Windows XP but not under Windows 7?
Get-WmiObject -Class win32_logonsession | %{ get-wmiobject -Query "Associators of {Win32_logonSession.LogonID=$($_.LogonId)} where AssocClass = Win32_LoggedOnUser Role=Dependent" }
Under Windows 7 it doesn't list any interactive accounts, only sessions for the local system account, network service etc. However under XP it returns information for all accounts.
Have been looking on MSDN and Google however haven't found an answer as yet.