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!

ADSI Script

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 very lost.
I guess that is what happens when a Hardware tech gets promoted to one of the Domain admins.
 
i did it didn't help me.
It doesn't even have a move script.

I had to find that else were.
 
the second place is were i got the move file from.
 
I'll begin by asking why you feel the need to dynamically move a computer object from ou to ou based on the physical location of the computer?
 
for better managment.

We have admins that arn't worth there weight in SH!T.
At least you can use that for something.

They have a bad habit of moving pc's from one Physical building to another. One program office to another etc...
But the never tell us.

The problem comes in when SMS goest to distribute a software title to the wrong machine because it is in the wrong building or what ever.

Just trust me this is worth the effort.

As of now you guys can forget about this task. I found someone willing to help me build the script in perl.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top