IP Address Filtering WMI

Kerguelen -  
 Kerguelen -
Hello,
I am looking for the WMI query that would allow me to filter by an IP address.
I need the computers in the active IP range A to apply this GPO, while other IP addresses will have a different GPO.

Can someone help me?

Sincerely

4 answers

  1. Chris_33000 Posted messages 533 Status Member 48
     
    Hello,
    the most efficient way is to create groups of computers based on their IP (VLAN) and then filter with these groups,
    however, if your computers often switch from one VLAN to another (e.g. laptops), this will indeed pose a problem,
    you can consult this topic for information:
    https://community.spiceworks.com/topic/2136706-problem-applying-gpo-with-wmi-filter
    Also, WMI queries are known for their slowness,
    Best regards,
    0
    1. Kerguelen
       
      It's precisely for laptops that the problem exists
      I need them to comply with GPOs when they are on-site (DHCP with IP range A) and another GPO when they are off-site via VPN.
      0
  2. Chris_33000 Posted messages 533 Status Member 48
     
    VPN: Does the VPN connection occur without user intervention? For example, at startup or as soon as a session is opened.
    0
    1. Kerguelen
       
      No, I don't need the GPOs to update in real time, so I will rely on the periodic refresh of the GPOs when the computer checks the GPOs from time to time.
      0
  3. Chris_33000 Posted messages 533 Status Member 48
     
    Hors site + VPN, the laptop connects to the internet through a private ISP, like the user's router... If so, it will have 2 active IPs, right?
    0
    1. Kerguelen
       
      Yes exactly, and it will apply the other GPO since it will not have access to the one filtered by the WMI.
      0
  4. Chris_33000 Posted messages 533 Status Member 48
     
    Yes, it should work... (if the VPN connection is not automatic) if lan gpo_1 otherwise gpo_2
    Now we just need to test the Spiceworks solution :) (especially test the command line query first)
    Good luck,
    0
    1. Kerguelen
       
      Well, that's exactly why I was asking, I can't seem to find the query.
      0