Hi,
I would like to join multiple machines to the domain. Netdom wouldn't be
support list of computers, or I am wrong. Do I have to build a loop to
check in the file or what? 

R o n e n   K f i r
System Administrator
CIT div. Tel Aviv University
Israel
Tel: 972-3-6407416
Fax: 972-3-6405158
cellular: 972-55-405910
E-mail: [EMAIL PROTECTED]
 
 

-----Original Message-----
From: Kipp, James [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 23, 2003 2:33 PM
To: Ronen Kfir
Subject: RE: join machines to domain

 
> Hi,
> I want to automate the process of joining machines to the domain. My
> goal is to have tool that will look at a text file containing IP
> addresses & join them to the domain.
> Has anyone ever done it, or have an idea how to do it?

Hi
I used the netdom util to do this. Here is my script that reads a file
with
a list of machine names and joins them:
----
 use strict;

my $ws;
my $domain = "BLAH";
my $dom_admin = "blah\\jkipp";
my $dom_pw = "password";
my $ws_admin ;
my $ws_pw = "ws_pwd";

open (MACH, "<ws.txt") or die ("Cant open: $!");
open (ERR, ">err.out") or die ("Cant open: $!"); 

while (<MACH>)
{
        $ws = $_;
        chomp $ws;
      $ws_admin = "$ws\\administrator";
      system("NETDOM JOIN $ws /Domain:$domain /UserD:$dom_admin
        /PasswordD:$dom_pw /UserO:$ws_admin /PasswordO:$ws_pw
/reboot:5");

      my $err = $? >> 8; 
        if ($err) { print ERR "Machine: $ws failed on join\n" }
        else {print ERR "Machine: $ws joined successfully\n"}  

        sleep 10; 
}
close (MACH);
 



_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to