Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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

share|improve this question
How about trying: Destination Like '10.31.%.%' – joeqwerty Aug 7 '12 at 23:17
Well to be honest I didn't try. But according to… % should just work fine! – CHfish Aug 8 '12 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 Aug 8 '12 at 12:26

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.