|
IP grouping can be tricky since it's not predictable as to which NIC DS will choose as NIC1 and use for the IP. All the same, this is a common practice for me. I like to create groups based on subnets and create a script like this one:
/*For Group A*/
UPDATE Computer SET group_id = 20
FROM Computer c INNER JOIN nic_interface nic on c.computer_id = nic.[id]
WHERE nic.ip LIKE '10.10.10.%' AND nic.[mask] = '255.255.255.0'
UPDATE Computer SET group_id = 20
FROM Computer c INNER JOIN nic_interface nic on c.computer_id = nic.[id]
WHERE nic.ip LIKE '10.10.11.%' AND nic.[mask] = '255.255.255.0'
/*For Group B*/
UPDATE Computer SET group_id = 21
FROM Computer c INNER JOIN nic_interface nic on c.computer_id = nic.[id]
WHERE nic.ip LIKE '10.10.20.%' AND nic.[mask] = '255.255.255.0'
/*For Group C*/
UPDATE Computer SET group_id = 22
FROM Computer c INNER JOIN nic_interface nic on c.computer_id = nic.[id]
WHERE nic.ip LIKE '10.10.30.%' AND nic.[mask] = '255.255.255.0'
UPDATE Computer SET group_id = 22
FROM Computer c INNER JOIN nic_interface nic on c.computer_id = nic.[id]
WHERE nic.ip LIKE '10.10.31.%' AND nic.[mask] = '255.255.255.0'
I put all of this in a .sql file and I run a call a bat file from a job if I need the groups to be straight for job execution. I do this primarily because I like to use folder heirarchy as a token.
__________________
______________________
Mike Ainsworth
|