$Win32::OLE::Warn=2; my $strServer="ad1.maboite.com"; my $dom="maboite.com"; my $objDNS=Win32::OLE->GetObject("winMgmts:\\$strServer\root\MicrosoftDNS"); my $objDNSZone=$objDNS->Get("MicrosoftDNS_Zone"); my $objRR=$objDNS->Get("MicrosoftDNS_ResourceRecord");

open FILE, "<intranet.csv"; my @intranet=<FILE>; close FILE;<fixed-ip.csv”; address="<FILE” my="“>

foreach my $line (@address) { my ($ip,$add)=split /;/,$line; chop $add; print "$ip -> $add\n"; my ($a,$b,$c,$d)=split /./, $ip; my $fAdd="$add.$dom. IN A $ip"; my $arpa="$c.$b.$a.in-addr.arpa"; my $rAdd="$arpa IN PTR $add.$dom"; my $ret = $objDNSZone->CreateZone($arpa, 0 , True); my $strNull = $objRR->CreateInstanceFromTextRepresentation( $objDNSZone->Name, $dom, $fAdd, $objOutParam); $strNull = $objRR->CreateInstanceFromTextRepresentation( $objDNSZone->Name, $arpa, $rAdd, $objOutParam); } </fixed-ip.csv”;>