none
WMI filter on computer name returning true and false

    Question

  • I have set up a couple WMI filters which appear to be mutually exclusive, but which, according to GP modeling, are both resolving to true:

    "Not on the terminal server"

    Select name from Win32_ComputerSystem where NOT name LIKE "HSP-RDS%"

    "On the terminal server"

    Select name from Win32_ComputerSystem where name LIKE "HSP-RDS%"


    When I run Group Policy Modeling for a specific user on HSP-RDS-TEMP, it says that both of the two WMI queries above are returning TRUE.  However, when I test the queries against the machine specifically using WBEMTEST or SDM's WMI Validation tool, it resolves correctly with "Not on the terminal server" being FALSE and "On the terminal server" being TRUE.

    How is it possible that both of these queries are returning TRUE?  I'm thinking that it is testing it under the computer context and that is resolved as TRUE, but then testing under the user context and that comes up FALSE.  I do note that both WMI filters come up as TRUE only under the User Details section and only the "On the Terminal Server" is shown for the Computer Details section.   What is WMI filtering for if not for the purpose I'm trying to apply it to?  How can the User processing part have both of them TRUE?

    (I have some policies that I want only applied when someone is logged into one of these servers and I have some policies that are applied only when someone is logged into some machine other than these two machines - I obviously am not trying to apply both of these filters to the same GPO, which would be ridiculous and the reason I use LIKE and the % is because I have a server with -TEMP appended to its name which I am using for testing purposes and I want the query to be true on both machines.)

    <textarea style="height:80px;width:444px;border:1px solid grey;padding:2px;"></textarea><select><option value="af">Afrikaans</option><option value="sq">Albanian</option><option value="ar">Arabic</option><option value="hy">Armenian</option><option value="az">Azerbaijani</option><option value="eu">Basque</option><option value="be">Belarusian</option><option value="bg">Bulgarian</option><option value="ca">Catalan</option><option value="zh-CN">Chinese (Simplified)</option><option value="zh-TW">Chinese (Traditional)</option><option value="hr">Croatian</option><option value="cs">Czech</option><option value="da">Danish</option><option selected="selected" value="auto">Detect language</option><option value="nl">Dutch</option><option value="en">English</option><option value="et">Estonian</option><option value="tl">Filipino</option><option value="fi">Finnish</option><option value="fr">French</option><option value="gl">Galician</option><option value="ka">Georgian</option><option value="de">German</option><option value="el">Greek</option><option value="ht">Haitian Creole</option><option value="iw">Hebrew</option><option value="hi">Hindi</option><option value="hu">Hungarian</option><option value="is">Icelandic</option><option value="id">Indonesian</option><option value="ga">Irish</option><option value="it">Italian</option><option value="ja">Japanese</option><option value="ko">Korean</option><option value="la">Latin</option><option value="lv">Latvian</option><option value="lt">Lithuanian</option><option value="mk">Macedonian</option><option value="ms">Malay</option><option value="mt">Maltese</option><option value="no">Norwegian</option><option value="fa">Persian</option><option value="pl">Polish</option><option value="pt">Portuguese</option><option value="ro">Romanian</option><option value="ru">Russian</option><option value="sr">Serbian</option><option value="sk">Slovak</option><option value="sl">Slovenian</option><option value="es">Spanish</option><option value="sw">Swahili</option><option value="sv">Swedish</option><option value="th">Thai</option><option value="tr">Turkish</option><option value="uk">Ukrainian</option><option value="ur">Urdu</option><option value="vi">Vietnamese</option><option value="cy">Welsh</option><option value="yi">Yiddish</option></select><select><option value="af">Afrikaans</option><option value="sq">Albanian</option><option value="ar">Arabic</option><option value="hy">Armenian</option><option value="az">Azerbaijani</option><option value="eu">Basque</option><option value="be">Belarusian</option><option value="bg">Bulgarian</option><option value="ca">Catalan</option><option value="zh-CN">Chinese (Simplified)</option><option value="zh-TW">Chinese (Traditional)</option><option value="hr">Croatian</option><option value="cs">Czech</option><option value="da">Danish</option><option value="nl">Dutch</option><option value="en">English</option><option value="et">Estonian</option><option value="tl">Filipino</option><option value="fi">Finnish</option><option value="fr">French</option><option value="gl">Galician</option><option value="ka">Georgian</option><option value="de">German</option><option value="el">Greek</option><option value="ht">Haitian Creole</option><option value="iw">Hebrew</option><option value="hi">Hindi</option><option selected="selected" value="hu">Hungarian</option><option value="is">Icelandic</option><option value="id">Indonesian</option><option value="ga">Irish</option><option value="it">Italian</option><option value="ja">Japanese</option><option value="ko">Korean</option><option value="la">Latin</option><option value="lv">Latvian</option><option value="lt">Lithuanian</option><option value="mk">Macedonian</option><option value="ms">Malay</option><option value="mt">Maltese</option><option value="no">Norwegian</option><option value="fa">Persian</option><option value="pl">Polish</option><option value="pt">Portuguese</option><option value="ro">Romanian</option><option value="ru">Russian</option><option value="sr">Serbian</option><option value="sk">Slovak</option><option value="sl">Slovenian</option><option value="es">Spanish</option><option value="sw">Swahili</option><option value="sv">Swedish</option><option value="th">Thai</option><option value="tr">Turkish</option><option value="uk">Ukrainian</option><option value="ur">Urdu</option><option value="vi">Vietnamese</option><option value="cy">Welsh</option><option value="yi">Yiddish</option></select>
    Detect language » Hungarian
    Wednesday, October 12, 2016 12:41 AM

Answers

  • Hi,
     
    Am 12.10.2016 um 02:41 schrieb mansnes:
    > I have set up a couple WMI filters which appear to be mutually
    > exclusive, but which, according to GP modeling, are both resolving to
    > true:
     
    The GPOs are User GPOs, linked to the user and terminalservers OU and
    the Loopback is configured to "merge"?
     
    Then "not TS" will apply, when the user gets GPOs applied from his OU
    and because of "merge" the "is TS" will apply when the Loop applies the
    users GPOs from the terminal servers OU.
     
    Mark
    --
    Mark Heitbrink - MVP Group Policy - Cloud and Datacenter Management
     
    Homepage:  http://www.gruppenrichtlinien.de - deutsch
     
    • Proposed as answer by Todd Heron Wednesday, October 12, 2016 12:30 PM
    • Marked as answer by Jay GuModerator Tuesday, October 18, 2016 10:46 AM
    Wednesday, October 12, 2016 9:03 AM
  • > When I run Group Policy Modeling for a specific user on HSP-RDS-TEMP, it
     
    In GP Modeling, it is up to YOU to specify which filters should be
    assumed to evaluate to true and which to evaluate to false. GP Modeling
    cannot do this for you because it is not running on the targeted machine
    and not with the targeted user.
     
    Thursday, October 13, 2016 12:12 PM

All replies

  • Hi,
     
    Am 12.10.2016 um 02:41 schrieb mansnes:
    > I have set up a couple WMI filters which appear to be mutually
    > exclusive, but which, according to GP modeling, are both resolving to
    > true:
     
    The GPOs are User GPOs, linked to the user and terminalservers OU and
    the Loopback is configured to "merge"?
     
    Then "not TS" will apply, when the user gets GPOs applied from his OU
    and because of "merge" the "is TS" will apply when the Loop applies the
    users GPOs from the terminal servers OU.
     
    Mark
    --
    Mark Heitbrink - MVP Group Policy - Cloud and Datacenter Management
     
    Homepage:  http://www.gruppenrichtlinien.de - deutsch
     
    • Proposed as answer by Todd Heron Wednesday, October 12, 2016 12:30 PM
    • Marked as answer by Jay GuModerator Tuesday, October 18, 2016 10:46 AM
    Wednesday, October 12, 2016 9:03 AM
  • > When I run Group Policy Modeling for a specific user on HSP-RDS-TEMP, it
     
    In GP Modeling, it is up to YOU to specify which filters should be
    assumed to evaluate to true and which to evaluate to false. GP Modeling
    cannot do this for you because it is not running on the targeted machine
    and not with the targeted user.
     
    Thursday, October 13, 2016 12:12 PM
  • Hi,

    Are there any updates?

    If the reply above has resolved your problem, please mark it as answer as it would be helpful to anyone who encounters the similar issue.

    Thank You.

    Best Regards,

    Jay


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, October 17, 2016 2:42 AM
    Moderator
  • There is no loopback and no merge involved at all. Interestingly enough, now when it processes the modeling, the WMI filters section on the Details tab under the Computer Details lists one of the WMI filters by "MSFT_SomFilter.ID='19824576-E1E9-4129-90C4-77A3B226B0EB}'.Domain='domain.local'".

    When going through the Modeling wizard, when I get to the "WMI Filters for Users" it shows both of the two filters when I hit List Filters, but only shows Not on the Terminal Server under the WMI Filters for Computers.  Since it apparently won't actually test the WMI filter directly and I have to tell it which is appropriate, I choose to remove them both under the user setting, but under the computer WMI filter pane, I cannot choose the appropriate option since it doesn't appear.

    Tuesday, October 18, 2016 7:01 PM
  • > "MSFT_SomFilter.ID='19824576-E1E9-4129-90C4-77A3B226B0EB}'.Domain=/'domain/.local'".
     
    Hmmmm - there seems to be something wrong with the WMI filter container
    in your active directory...
     
    Wednesday, October 19, 2016 3:55 PM