none
Item Level Targeting using WMI

    Question

  • I'm trying to use a WMI query in a Preference's Item Level Targeting but can't get it to work. I'm not able to find any documentation regarding how to fill out the fields in the WMI targeting item. Of the many posts I've read, few discuss issues with WMI Item Level Targeting. The queries below run successfully in wbemtest but using them in the group policy does not apply the preference. I've tested with and without "Run in logged-on user's security context".

    Queries:

    SELECT * FROM Win32_Printer Where DeviceID = "\\\\[printservername]\\ATLHP29119B"
    SELECT DeviceID FROM Win32_Printer Where DeviceID = "\\\\[printservername]\\ATLHP29119B"
    SELECT * FROM Win32_Printer Where Name = "\\\\[printservername]\\ATLHP29119B"

    Namespace:

    root\cimv2

    Property:

    ? What goes here? I've tested with DeviceID and Name and blank and variations of the Where clause but nothing works.

    Group policy preferences logging does not show detail regarding the execution of the WMI query during the preference evaluation. Is there some way to log that level of detail?

    Thanks.

    Thursday, May 17, 2018 4:38 PM

All replies

  • SELECT * FROM Win32_Printer Where DeviceID = "\\\\[printservername]\\ATLHP29119B"
    SELECT DeviceID FROM Win32_Printer Where DeviceID = "\\\\[printservername]\\ATLHP29119B"
    SELECT * FROM Win32_Printer Where Name = "\\\\[printservername]\\ATLHP29119B"

    The second one is the type of query I would recommend. Since we are talking about a network printer: Is this printer available? And can it be found through WMI in system context? (psexec -s)

    Property:

    Only needed if you want to assign the value of a given property to a temporary environment variable. This variable can be used somewhere else within GPP - maybe to create a real env var, maybe to compose a path.

    Friday, May 18, 2018 7:30 AM