Ok here is the situation
I need a script that will scan Active directory and get all of the computers in the DB. Then one at a time I want it to check the subnet of the computer and the OU that the computer resides in and see if they match according to the pre assigned list. If it doesn't match then I want it to scan a list and see were it belongs. Then move it to that OU and send me an Email saying it was moved.
So the situation would be:
Computer A is in subnet 123.234.123.4 and it's in OU AA
The predefined list says that 123.234.123.0 is assigned to AA
So the machine stays were it is.
Next loop to next computer
Computer B is in subnet 123.234.125.89 and it is in OU BB
The predefined list says that 123.234.125.0 is assigned to AB.
The machine is in the wrong OU.
Move machine to OU AB.
Next send me an email.
Next loop to next computer
This will go very fast because only about 3% will be moved at any given time.
I know that this is possible I'm just not sure how to put it all together. I’m very lost.
I guess that is what happens when a Hardware tech gets promoted to one of the Domain admins.
I need a script that will scan Active directory and get all of the computers in the DB. Then one at a time I want it to check the subnet of the computer and the OU that the computer resides in and see if they match according to the pre assigned list. If it doesn't match then I want it to scan a list and see were it belongs. Then move it to that OU and send me an Email saying it was moved.
So the situation would be:
Computer A is in subnet 123.234.123.4 and it's in OU AA
The predefined list says that 123.234.123.0 is assigned to AA
So the machine stays were it is.
Next loop to next computer
Computer B is in subnet 123.234.125.89 and it is in OU BB
The predefined list says that 123.234.125.0 is assigned to AB.
The machine is in the wrong OU.
Move machine to OU AB.
Next send me an email.
Next loop to next computer
This will go very fast because only about 3% will be moved at any given time.
I know that this is possible I'm just not sure how to put it all together. I’m very lost.
I guess that is what happens when a Hardware tech gets promoted to one of the Domain admins.