I need to apply a GPO only to some computers in a specific network range.

I'm aware that there many other solutions for this issue. I could group them into an OU or use Sites. But the current situation doesn't allow me to act in any other way except to determine if the IP address of the client is in a specific network.

Therefore I assumed I could use a WMI filter and I asked my good friend Google for help: I found http://waynes-world-it.blogspot.ch/2008/03/wmi-filter-for-subnet-filtered-group.html but

Select * FROM Win32_IP4RouteTable
WHERE ((Mask='' AND NextHop='')
AND (Destination Like '10.31.%'))

doesn't seem to work. The policy isn't applied to any computer due to the filter. Can anyone give me hint how this could be solved?

Thank you very much

  • How about trying: Destination Like '10.31.%.%'
    – joeqwerty
    Commented Aug 7, 2012 at 23:17
  • Well to be honest I didn't try. But according to msdn.microsoft.com/en-us/library/windows/desktop/… % should just work fine!
    – CHfish
    Commented Aug 8, 2012 at 11:36
  • Right, but in the link in your question it's parsing all 4 octets but in your string it looks like it's only parsing 3 octets so maybe it's not evaluating the ip address correctly.
    – joeqwerty
    Commented Aug 8, 2012 at 12:26

1 Answer 1


Got it:

SELECT * from Win32_IP4RouteTable 
       WHERE ((Mask='' AND NextHop LIKE '10.31.%'))

Works perfect. Seems the sample is either wrong or at least not applicable to Windows Server 2008 R2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .