Feat: SRV-01 DNS Beta+Diff Kill
This commit is contained in:
parent
dd0d388334
commit
07425d4de6
|
@ -126,12 +126,12 @@ Get-DhcpServerv4Scope | Set-DhcpServerv4OptionValue -DnsServer 192.168.128.1,192
|
||||||
Install-WindowsFeature -Name DNS -IncludeManagementTools -includeallsubfeature
|
Install-WindowsFeature -Name DNS -IncludeManagementTools -includeallsubfeature
|
||||||
|
|
||||||
#Create asrbd.local zone
|
#Create asrbd.local zone
|
||||||
Set-DnsServerPrimaryZone -ComputerName SRV-01 -Name asrbd.local -SecureSecondaries "TransferToSecureServers" -SecondaryServers "192.168.128.1"
|
Set-DnsServerPrimaryZone -ComputerName SRV-01 -Name "asrbd.local" -SecureSecondaries "TransferToSecureServers" -SecondaryServers "192.168.128.1"
|
||||||
|
|
||||||
Add-DnsServerPrimaryZone -ResponsiblePerson "bol@loc.ks" -DynamicUpdate None -ZoneFile asrbd.local.dns -Name asrbd.local
|
Add-DnsServerPrimaryZone -ResponsiblePerson bol@loc.ks -DynamicUpdate None -ZoneFile asrbd.local.dns -Name asrbd.local
|
||||||
|
|
||||||
#Rename SOA+NS Main Zone
|
#Rename SOA+NS Main Zone
|
||||||
$ns = Get-DnsServerResourceRecord -ZoneName asrbd.local -RRType NS
|
$ns = Get-DnsServerResourceRecord -ZoneName "asrbd.local" -RRType NS
|
||||||
|
|
||||||
$nsnew = $ns.Clone()
|
$nsnew = $ns.Clone()
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ Set-DnsServerResourceRecord -ZoneName asrbd.local -NewInputObject $soanew -OldIn
|
||||||
Set-DnsServerPrimaryZone -ComputerName SRV-01 -Name asrbd.local -SecureSecondaries "TransferToSecureServers" -SecondaryServers "192.168.128.1"
|
Set-DnsServerPrimaryZone -ComputerName SRV-01 -Name asrbd.local -SecureSecondaries "TransferToSecureServers" -SecondaryServers "192.168.128.1"
|
||||||
|
|
||||||
#Create reverse lookup Zone
|
#Create reverse lookup Zone
|
||||||
Add-DnsServerPrimaryZone -NetworkID "192.168.0.0/24" -Zonefile "168.192.in-addr.arpa.dns"
|
Add-DnsServerPrimaryZone -NetworkID "192.168.0.0/16" -Zonefile "168.192.in-addr.arpa.dns"
|
||||||
|
|
||||||
#Rename SOA+NS Reverse
|
#Rename SOA+NS Reverse
|
||||||
$ns = Get-DnsServerResourceRecord -ZoneName 168.192.in-addr.arpa -RRType NS
|
$ns = Get-DnsServerResourceRecord -ZoneName 168.192.in-addr.arpa -RRType NS
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Stop-VM CLI* -turnoff
|
Stop-VM CLI* -turnoff
|
||||||
Remove-VM CLI* -Force
|
Remove-VM CLI* -Force
|
||||||
|
|
||||||
del d:\VHD\CLI*
|
del d:\VHD\CLI*
|
|
@ -1,82 +1,82 @@
|
||||||
## Tool to automate VM creation
|
## Tool to automate VM creation
|
||||||
|
|
||||||
echo "Shamefully made by Alexandre Simao. Pardon-me dear M. Stallman"
|
echo "Shamefully made by Alexandre Simao. Pardon-me dear M. Stallman"
|
||||||
echo "GPLv3"
|
echo "GPLv3"
|
||||||
|
|
||||||
### Considered as finished. Need improvement VM side.
|
### Considered as finished. Need improvement VM side.
|
||||||
|
|
||||||
### Adding CLI-01
|
### Adding CLI-01
|
||||||
|
|
||||||
echo "Adding and configuring CLI-01"
|
echo "Adding and configuring CLI-01"
|
||||||
cp D:\VHD\Base\Base_Client_dif.vhdx D:\VHD\CLI-01.vhdx
|
cp D:\VHD\Base\Base_Client_dif.vhdx D:\VHD\CLI-01.vhdx
|
||||||
|
|
||||||
Mount-VHD d:\VHD\CLI-01.vhdx
|
Mount-VHD d:\VHD\CLI-01.vhdx
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
Copy-Item d:\Scripts\Unattend\Fullunattend-Win10.xml -Destination f:\Windows\Panther\Unattend.xml
|
Copy-Item d:\Scripts\Unattend\Fullunattend-Win10.xml -Destination f:\Windows\Panther\Unattend.xml
|
||||||
=======
|
=======
|
||||||
Copy-Item d:\Unattend\Fullunattend-Win10.xml -Destination f:\Windows\Panther\Unattend.xml
|
Copy-Item d:\Unattend\Fullunattend-Win10.xml -Destination f:\Windows\Panther\Unattend.xml
|
||||||
>>>>>>> DNS
|
>>>>>>> DNS
|
||||||
#mkdir e:\Tools\Scripts
|
#mkdir e:\Tools\Scripts
|
||||||
#Copy-item d:\Scripts\Guests\CLI-01.ps1 E:\Tools\scripts
|
#Copy-item d:\Scripts\Guests\CLI-01.ps1 E:\Tools\scripts
|
||||||
mkdir "f:\Program Files\BGINFO"
|
mkdir "f:\Program Files\BGINFO"
|
||||||
Copy-Item d:\Soft\BGInfo_Deploiement\BGInfo.exe "f:\Program Files\BGINFO"
|
Copy-Item d:\Soft\BGInfo_Deploiement\BGInfo.exe "f:\Program Files\BGINFO"
|
||||||
Copy-Item d:\Soft\BGInfo_Deploiement\mescouilles2.bgi "f:\Program Files\BGINFO"
|
Copy-Item d:\Soft\BGInfo_Deploiement\mescouilles2.bgi "f:\Program Files\BGINFO"
|
||||||
Copy-Item D:\Soft\BGInfo_Deploiement\bginfox86.bat "f:\Users\AdminLocal\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
|
Copy-Item D:\Soft\BGInfo_Deploiement\bginfox86.bat "f:\Users\AdminLocal\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
|
||||||
Dismount-VHD d:\VHD\CLI-01.vhdx
|
Dismount-VHD d:\VHD\CLI-01.vhdx
|
||||||
|
|
||||||
$vms = @{
|
$vms = @{
|
||||||
|
|
||||||
Name = "CLI-01"
|
Name = "CLI-01"
|
||||||
Generation = '1'
|
Generation = '1'
|
||||||
MemoryStartupBytes = 1024Mb
|
MemoryStartupBytes = 1024Mb
|
||||||
VHDPath = "d:\VHD\CLI-01.vhdx"
|
VHDPath = "d:\VHD\CLI-01.vhdx"
|
||||||
SwitchName = "Arc-CLI"
|
SwitchName = "Arc-CLI"
|
||||||
}
|
}
|
||||||
|
|
||||||
New-VM @vms
|
New-VM @vms
|
||||||
Set-VMMemory CLI-01 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
|
Set-VMMemory CLI-01 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
|
||||||
Set-VM -Name CLI-01 -ProcessorCount 2
|
Set-VM -Name CLI-01 -ProcessorCount 2
|
||||||
|
|
||||||
echo "Configuring adapters"
|
echo "Configuring adapters"
|
||||||
Rename-VMNetworkAdapter -VMName 'CLI-01' -NewName 'Arc-CLI'
|
Rename-VMNetworkAdapter -VMName 'CLI-01' -NewName 'Arc-CLI'
|
||||||
|
|
||||||
|
|
||||||
### Adding and configuring CLI-03
|
### Adding and configuring CLI-03
|
||||||
|
|
||||||
echo "Adding and configuring CLI-03"
|
echo "Adding and configuring CLI-03"
|
||||||
cp D:\VHD\Base\Base_Client_dif.vhdx D:\VHD\CLI-03.vhdx
|
cp D:\VHD\Base\Base_Client_dif.vhdx D:\VHD\CLI-03.vhdx
|
||||||
|
|
||||||
Mount-VHD d:\VHD\CLI-03.vhdx
|
Mount-VHD d:\VHD\CLI-03.vhdx
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
Copy-Item d:\Scripts\Unattend\Fullunattend-Win10.xml -Destination f:\Windows\Panther\Unattend.xml
|
Copy-Item d:\Scripts\Unattend\Fullunattend-Win10.xml -Destination f:\Windows\Panther\Unattend.xml
|
||||||
=======
|
=======
|
||||||
Copy-Item d:\Unattend\Fullunattend-Win10.xml -Destination f:\Windows\Panther\Unattend.xml
|
Copy-Item d:\Unattend\Fullunattend-Win10.xml -Destination f:\Windows\Panther\Unattend.xml
|
||||||
>>>>>>> DNS
|
>>>>>>> DNS
|
||||||
#mkdir e:\Tools\Scripts
|
#mkdir e:\Tools\Scripts
|
||||||
#Copy-item d:\Scripts\Guests\CLI-03.ps1 E:\Tools\scripts
|
#Copy-item d:\Scripts\Guests\CLI-03.ps1 E:\Tools\scripts
|
||||||
mkdir "f:\Program Files\BGINFO"
|
mkdir "f:\Program Files\BGINFO"
|
||||||
Copy-Item d:\Soft\BGInfo_Deploiement\BGInfox86.exe "f:\Program Files\BGINFO"
|
Copy-Item d:\Soft\BGInfo_Deploiement\BGInfox86.exe "f:\Program Files\BGINFO"
|
||||||
Copy-Item d:\Soft\BGInfo_Deploiement\mescouilles2.bgi "f:\Program Files\BGINFO"
|
Copy-Item d:\Soft\BGInfo_Deploiement\mescouilles2.bgi "f:\Program Files\BGINFO"
|
||||||
Copy-Item D:\Soft\BGInfo_Deploiement\bginfox86.bat "f:\Users\AdminLocal\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
|
Copy-Item D:\Soft\BGInfo_Deploiement\bginfox86.bat "f:\Users\AdminLocal\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
|
||||||
Dismount-VHD d:\VHD\CLI-03.vhdx
|
Dismount-VHD d:\VHD\CLI-03.vhdx
|
||||||
|
|
||||||
$vms = @{
|
$vms = @{
|
||||||
|
|
||||||
Name = "CLI-03"
|
Name = "CLI-03"
|
||||||
Generation = '1'
|
Generation = '1'
|
||||||
MemoryStartupBytes = 1024Mb
|
MemoryStartupBytes = 1024Mb
|
||||||
VHDPath = "d:\VHD\CLI-03.vhdx"
|
VHDPath = "d:\VHD\CLI-03.vhdx"
|
||||||
SwitchName = "Bou-LAN"
|
SwitchName = "Bou-LAN"
|
||||||
}
|
}
|
||||||
|
|
||||||
New-VM @vms
|
New-VM @vms
|
||||||
Set-VMMemory CLI-03 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
|
Set-VMMemory CLI-03 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
|
||||||
Set-VM -Name CLI-03 -ProcessorCount 2
|
Set-VM -Name CLI-03 -ProcessorCount 2
|
||||||
|
|
||||||
echo "Configuring adapters"
|
echo "Configuring adapters"
|
||||||
#Set-VMNetworkAdapter -VMNetworkAdapter $vmadapter[0] -Name "Bou-LAN" -DeviceNaming on
|
#Set-VMNetworkAdapter -VMNetworkAdapter $vmadapter[0] -Name "Bou-LAN" -DeviceNaming on
|
||||||
Rename-VMNetworkAdapter -VMName 'CLI-03' -NewName 'Bou-LAN'
|
Rename-VMNetworkAdapter -VMName 'CLI-03' -NewName 'Bou-LAN'
|
||||||
|
|
||||||
### Starting VMS
|
### Starting VMS
|
||||||
echo "Starting VMs"
|
echo "Starting VMs"
|
||||||
Start-VM -Name CLI*
|
Start-VM -Name CLI*
|
|
@ -0,0 +1,67 @@
|
||||||
|
### Adding SRV-01
|
||||||
|
|
||||||
|
echo "Adding and configuring SRV-01"
|
||||||
|
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\SRV-01.vhdx
|
||||||
|
|
||||||
|
$Lettre = Mount-VHD -Path "d:\VHD\SRV-01.VHDx" -PassThru | Get-Disk | Get-Partition | Get-Volume | Sort-Object -Property Size -Descending | Select-Object -First 1
|
||||||
|
$DriveLetter = $Lettre.DriveLetter
|
||||||
|
$drive = $DriveLetter + ":"
|
||||||
|
Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination "$Drive\Windows\Panther\Unattend.xml"
|
||||||
|
Copy-Item D:\Scripts\deploy.cmd -Destination "${Driveletter}:\conf\deploy.cmd"
|
||||||
|
mkdir "${Driveletter}:\Tools\Scripts"
|
||||||
|
Copy-item d:\Scripts\Guests\SRV-01.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"
|
||||||
|
|
||||||
|
Dismount-VHD d:\VHD\SRV-01.vhdx
|
||||||
|
|
||||||
|
$vms = @{
|
||||||
|
|
||||||
|
Name = "SRV-01"
|
||||||
|
Generation = '2'
|
||||||
|
MemoryStartupBytes = 1024Mb
|
||||||
|
VHDPath = "d:\VHD\SRV-01.vhdx"
|
||||||
|
SwitchName = "Arc-SRV"
|
||||||
|
}
|
||||||
|
|
||||||
|
New-VM @vms
|
||||||
|
Set-VMMemory SRV-01 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
|
||||||
|
Set-VM -Name SRV-01 -ProcessorCount 2
|
||||||
|
|
||||||
|
echo "Configuring adapters"
|
||||||
|
Rename-VMNetworkAdapter -VMName 'SRV-01' -NewName 'Arc-SRV'
|
||||||
|
Set-VMNetworkAdapter -VMName 'SRV-01' -Name "Arc-SRV" -DeviceNaming on
|
||||||
|
|
||||||
|
### Adding SRV-03
|
||||||
|
|
||||||
|
echo "Adding and configuring SRV-03"
|
||||||
|
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\SRV-03.vhdx
|
||||||
|
|
||||||
|
$Lettre = Mount-VHD -Path "d:\VHD\SRV-03.VHDx" -PassThru | Get-Disk | Get-Partition | Get-Volume | Sort-Object -Property Size -Descending | Select-Object -First 1
|
||||||
|
$DriveLetter = $Lettre.DriveLetter
|
||||||
|
$drive = $DriveLetter + ":"
|
||||||
|
Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination "$Drive\Windows\Panther\Unattend.xml"
|
||||||
|
Copy-Item D:\Scripts\deploy.cmd -Destination "${Driveletter}:\conf\deploy.cmd"
|
||||||
|
mkdir "${Driveletter}:\Tools\Scripts"
|
||||||
|
Copy-item d:\Scripts\Guests\SRV-03.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"
|
||||||
|
|
||||||
|
Dismount-VHD d:\VHD\SRV-03.vhdx
|
||||||
|
|
||||||
|
$vms = @{
|
||||||
|
|
||||||
|
Name = "SRV-03"
|
||||||
|
Generation = '2'
|
||||||
|
MemoryStartupBytes = 1024Mb
|
||||||
|
VHDPath = "d:\VHD\SRV-03.vhdx"
|
||||||
|
SwitchName = "Bou-LAN"
|
||||||
|
}
|
||||||
|
|
||||||
|
New-VM @vms
|
||||||
|
Set-VMMemory SRV-03 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
|
||||||
|
Set-VM -Name SRV-03 -ProcessorCount 2
|
||||||
|
|
||||||
|
echo "Configuring adapters"
|
||||||
|
|
||||||
|
Rename-VMNetworkAdapter -VMName 'SRV-03' -NewName 'Bou-LAN'
|
||||||
|
Set-VMNetworkAdapter -VMName 'SRV-03' -Name "Bou-Lan" -DeviceNaming on
|
||||||
|
|
||||||
|
|
||||||
|
Start-VM -Name SRV*
|
|
@ -0,0 +1,3 @@
|
||||||
|
Stop-VM SRV* -turnoff
|
||||||
|
|
||||||
|
del d:\VHD\SRV*
|
|
@ -1,7 +1,7 @@
|
||||||
Stop-VM RTR* -turnoff
|
Stop-VM RTR* -turnoff
|
||||||
Stop-VM SRV* -turnoff
|
Stop-VM SRV* -turnoff
|
||||||
Remove-VM RTR* -Force
|
Remove-VM RTR* -Force
|
||||||
Remove-VM SRV* -Force
|
Remove-VM SRV* -Force
|
||||||
|
|
||||||
del d:\VHD\RTR*
|
del d:\VHD\RTR*
|
||||||
del d:\VHD\SRV*
|
del d:\VHD\SRV*
|
Loading…
Reference in New Issue