Ok so in the environment im working in right now, the SCCM site is working towards two different domains, lets call them “Domain A” & “Domain B”. I would like my Task Sequence to join the computers it the right domain depending on what default gateway they have on the network.
I have tried the following, but im afraid neither works:
Select * from Win32_NetworkAdapterConfiguration where DefaultIPGateway=’x.x.x.x’
This will not work because the adapters are stored in an array.
I also found a way to do this use this query:
Select * FROM Win32_IP4RouteTable
WHERE Destination=’0.0.0.0′ AND NextHop=’x.x.x.x’
This queries the routing table, no details about the adapter need to be known. It work’s great just in general and in query’s but it will not work in a Task Sequence.
Looks like i have to install MDT. Thank you for all your answers.