Hi Matthieu,

 

it is much more easier to just rename sample-config.pl to config.pl and use the unattended.csv file. There is some documentation in it. Give it a try.

 

--

Moritz

 


Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Matthieu MARC
Gesendet: Mittwoch, 1. Juni 2005 08:01
An: [email protected]
Betreff: [Unattended] Assigning ComputerName dynamicaly

 


Hi everybody,

I have installed unattended on a w2k3 server. I managed to make an installation of a winxp client.

I want to say that it is a great job you have done, really.

Now, I wanted to assign ComputerName dynamicaly. I read the page http://unattended.sourceforge.net/dynamic.php and notice the example.
I put this example in my config.pl file.The problem is that when booting and executing this file, perl do not find socket.pm. Is this module must be installed on the linux-based boot file ?


Thanks for help.
Matthieu MARC

--------------------------------------------------

Assigning ComputerName based on DNS hostname

To automatically set the machine's ComputerName based on the DNS hostname associated with the IP address assigned to the machine:

use warnings;
use strict;
use Socket;
use Net::hostent;
 
$u->{'UserData'}->{'ComputerName'} =
    sub {
        my $addr = $u->{'_meta'}->{'ipaddr'};
        defined $addr
            or return undef;
        my $host = gethostbyaddr (inet_aton ($addr));
 
        if (!defined $host) {
            warn "Unable to gethostbyaddr ($addr): $? $^E\n";
            return undef;
        }
 
        my $name = $host->name ();
        # Strip off domain portion
        $name =~ s/\.(.*)//;
        return $name;
    };
 
1;

 

Reply via email to