Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need help

Status
Not open for further replies.

Flukster

IS-IT--Management
Aug 31, 2004
8
US
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 still learning Perl and I’m very lost.
I guess that is what happens when a Hardware tech gets promoted to one of the Domain admins.
 
That is a vague question. Looks like your looking for someone to do an entire project for you. You should go to a tech web site and post it as a project. Forums are for asking specific questions and problems while you are programming. Just start to program it and if you run into a problem post it individually. And when you do post a problem, think of a better title then "I need help". The purpose of a form is not to ask the same question a million times. They have a search feature here so if you ask a question that is answered, other people can find it.
 
You may want to get started here. There's probably something some similar scripts in the repository.

 
That is partly right. I'm looking for someone to Help me put it together.

I have parts of the code that needs to run. but i have no clue how to put them together in the form that i want.


I have a script to get the subnet from a machine.
I have a script that will pull all of the machines in a group but i don't have one that will pull all of the computers out of all of the ou's.

I have all of the subnets and OU assignments but i dont know what format i need to put them in to for then to be readable.

Th other problem is the scripts that i do have are in VBS not perl. and i don't know how to convert them.

I just started teaching myself perl on monday night.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top