0

I'm trying to write a WMI filter to prevent a GPO from applying to certain users

SELECT * from Win32_ComputerSystem WHERE NOT UserName LIKE 'domain\\user1_%' AND NOT UserName LIKE 'domain\\user2_%'

This works correctly if the user is logged onto the console but always returns false if the user is logged on via RDP.

Mark

EDIT:

There does seem to be a way to achieve this, it's described in method two of this article. Though, I am unsure of how to construct the query using Win32_Process?

1 Answers1

0

Could you try querying from Win32_LogonSession? http://msdn.microsoft.com/en-us/library/windows/desktop/aa394189(v=vs.85).aspx Seems LogonType tells whether the user is logged on through RDP.

woodings
  • 7,503
  • 5
  • 34
  • 52
  • Unfortunately, that class doesn't include the users username which is vital to the query. –  Nov 30 '12 at 17:37