M13LU Posted February 6, 2020 Report post Posted February 6, 2020 Hello everybody, I need to create an application that has different msi parameters depending on the VLAN the server is in. I thought i would use different Deployment types and determine the subnet by using a custom Global Condition. I started with creating a global condition using a powershell command (Get-NetIPConfiguration | Where-Object {$_.IPv4DefaultGateway}).IPv4DefaultGateway.nexthop this returns the ip address of the gateway but found out that this would only work on windows 2012r2 and above. There are still some 2008r2 servers here, so no good. I then decided to use a WMI query and tested it on every os. Get-WmiObject -Query "select DefaultipGateway from win32_networkadapterconfiguration where ipenabled='true'" created a wql query as Global Condition then created my requirement but when i try and deploy the application, it doesn't work. where am i going wrong here? Quote Share this post Link to post Share on other sites More sharing options...
Peter33 Posted February 7, 2020 Report post Posted February 7, 2020 You have to narrow it down to a single value result by filtering. WQL is not flexible enough to get you there. Try a powershell global condition like this. (Get-WmiObject -Namespace root\cimv2 -Class win32_networkadapterconfiguration -Filter "ipenabled='true'" | Where-Object {$_.DefaultIPGateway -like '*.*.*.*'} | select -First 1).DefaultIPGateway Quote Share this post Link to post Share on other sites More sharing options...