# Kod zamienia stref na zintegrowan z usug Active Directory

use Win32::OLE;
$Win32::OLE::Warn = 3;

# ------ KONFIGURACJA SKRYPTU ------
$strZone = '<NazwaStrefy>'; # np. rallencorp.com
$strServer = '<NazwaSerwera>'; # np. dc1.rallencorp.com
# ------ KONIEC KONFIGURACJI ---------
$objDNS = Win32::OLE->GetObject('winMgmts:\\\\' . $strServer . '\\root\\MicrosoftDNS');
$objDNSServer = $objDNS->Get('MicrosoftDNS_Server.Name="."');
$objDNSZone = $objDNS->Get('MicrosoftDNS_Zone.ContainerName="' . $strZone . '",DnsServerName="' . $objDNSServer->Name . '",Name="' . $strZone . '"');
$strNull = $objDNSZone->ChangeZoneType(0, 1);
$objDNSZone->Put_;
print 'Dokonano konwersji strefy ', $strZone, " na zintegrowan z usug Active Directory.\n";
