Compare commits

...

No commits in common. "master" and "DNS" have entirely different histories.
master ... DNS

30 changed files with 845 additions and 847 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
temp/
Host/.*

13
Guests/Arc-CLI.conf Normal file
View File

@ -0,0 +1,13 @@
pushd routing ip relay
Install
set global loglevel = ERROR
add dhcpserver 192.168.8.1
add interface name = "Arc-CLI"
set interface name = "Arc-CLI" relaymode = enable maxhop = 6 minsecs = 6
popd

11
Guests/Arc-SRV.conf Normal file
View File

@ -0,0 +1,11 @@
pushd routing ip relay
Install
set global loglevel = ERROR
add dhcpserver 192.168.8.1
add interface name = "Arc-SRV"
set interface name = "Arc-SRV" relaymode = enable maxhop = 6 minsecs = 6
popd

11
Guests/Bou-LAN.conf Normal file
View File

@ -0,0 +1,11 @@
pushd routing ip relay
Install
set global loglevel = ERROR
add dhcpserver 192.168.8.1
add interface name = "Bou-LAN"
set interface name = "Bou-LAN" relaymode = enable maxhop = 6 minsecs = 6
popd

View File

@ -41,11 +41,11 @@ netsh interface ip set address name="Arc-SRV" static 192.168.8.254 255.255.255.0
#Arc-CLI conf
netsh interface ip set address name="Arc-CLI" static 192.168.12.254 255.255.255.0
netsh interface ip set address name="Arc-CLI" static 192.168.12.8 255.255.255.0
### WAN conf
netsh interface ip set address name="WAN" static 192.168.255.8 255.255.255.0
netsh interface ip set address name="WAN" static 192.168.255.8 255.255.255.0 192.168.255.254
### DNS Conf for all InterfaceAlias ###

View File

@ -43,7 +43,7 @@ echo "Done!"
#WAN
echo "IP conf via netsh for WAN"
netsh interface ip set address name="WAN" static 192.168.255.128 255.255.255.0
netsh interface ip set address name="WAN" static 192.168.255.128 255.255.255.0 192.168.255.254
echo "Done!"
# END

View File

@ -2,9 +2,9 @@
# GPL v3
# SRV-01 ONLY
# asrc.local domain
# Microdown.local domain
# TODO: Delegation
# TODO: Set Option 15
echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman"
@ -39,7 +39,7 @@ netsh interface ip set address name="Arc-SRV" static 192.168.8.1 255.255.255.0 1
### DNS Conf for all InterfaceAlias ###
echo "DNS Conf"
foreach ($c in Get-NetAdapter) { write-host 'Setting DNS for' $c.interfaceName ; Set-DnsClientServerAddress -InterfaceIndex $c.interfaceindex -ServerAddresses ('192.168.8.1,192.168.128.1') }
foreach ($c in Get-NetAdapter) { write-host 'Setting DNS for' $c.interfaceName ; Set-DnsClientServerAddress -InterfaceIndex $c.interfaceindex -ServerAddresses ('192.168.8.1') }
### Install the DHCP role (Management tools if you love Metrosexual UI)
@ -103,7 +103,7 @@ $Params = @{
Set-NetFirewallRule @Params
# END
### Add routes for SRV-01
### Add routes for RTR-01
echo "Add routes for RTR-01"
route add -p 192.168.12.0/24 192.168.8.254
@ -112,94 +112,32 @@ route add -p 192.168.128.0/24 192.168.8.254
route add -p 0.0.0.0/0 192.168.8.254
# END
echo "Adding DHCP server options"
Set-DhcpServerv4OptionValue -ScopeId 192.168.128.0 -Router 192.168.128.254
Set-DhcpServerv4OptionValue -ScopeId 192.168.12.0 -Router 192.168.12.254
Set-DhcpServerv4OptionValue -ScopeId 192.168.8.0 -Router 192.168.8.254
Get-DhcpServerv4Scope | Set-DhcpServerv4OptionValue -DnsServer 192.168.128.1,192.168.8.1
### Installing and configuring DNS role
# Install and configure DNS server
Install-WindowsFeature -Name DNS -IncludeManagementTools -includeallsubfeature
#Create asrc.local zone
Add-DnsServerPrimaryZone -ResponsiblePerson bol@loc.ks -DynamicUpdate None -ZoneFile asrc.local.dns -Name asrc.local
Set-DnsServerPrimaryZone -ComputerName SRV-01 -Name "asrc.local" -SecureSecondaries "TransferToSecureServers" -SecondaryServers "192.168.128.1"
#Rename SOA+NS Main Zone
$ns = Get-DnsServerResourceRecord -ZoneName "asrc.local" -RRType NS
$nsnew = $ns.Clone()
$nsnew.RecordData.NameServer = "srv-01.asrc.local"
Set-DnsServerResourceRecord -ZoneName asrc.local -NewInputObject $nsnew -OldInputObject $ns
$soa = Get-DnsServerResourceRecord -ZoneName asrc.local -RRType Soa
$soanew = $soa.Clone()
$soanew.RecordData.PrimaryServer = "srv-01.asrc.local"
$soanew.RecordData.ExpireLimit = (New-TimeSpan -Days 4)
Set-DnsServerResourceRecord -ZoneName asrc.local -NewInputObject $soanew -OldInputObject $soa
#Set zone transfer
Set-DnsServerPrimaryZone -ComputerName SRV-01 -Name asrc.local -SecureSecondaries "TransferToZoneNameServer"
#Create reverse lookup Zone
Add-DnsServerPrimaryZone -NetworkID "192.168.0.0/16" -Zonefile "168.192.in-addr.arpa.dns"
Set-DnsServerPrimaryZone -Name 168.192.in-addr.arpa -SecureSecondaries "TransferToZoneNameServer" ###TO BE FIXED
#Rename SOA+NS Reverse
$ns = Get-DnsServerResourceRecord -ZoneName 168.192.in-addr.arpa -RRType NS
$nsnew = $ns.Clone()
$nsnew.RecordData.NameServer = "srv-01.asrc.local"
Set-DnsServerResourceRecord -ZoneName 168.192.in-addr.arpa -NewInputObject $nsnew -OldInputObject $ns
$soa = Get-DnsServerResourceRecord -ZoneName 168.192.in-addr.arpa -RRType Soa
$soanew = $soa.Clone()
$soanew.RecordData.PrimaryServer = "srv-01.asrc.local"
$soanew.RecordData.ExpireLimit = (New-TimeSpan -Days 4)
Set-DnsServerResourceRecord -ZoneName asrc.local -NewInputObject $soanew -OldInputObject $soa
# Set DNS SRV-03 forwarder
Add-DnsServerConditionalForwarderZone -Name "asrc.devs" -MasterServers 192.168.128.1 -PassThru
Add-DnsServerConditionalForwarderZone -Name "devs.asrc.devs" -MasterServers 192.168.128.1 -PassThru
# Set DNS net forwarder
Add-DnsServerPrimaryZone -NetworkID 192.168.8.0/24 -ZoneFile 192.168.8.1.in-addr.arpa.dns # Zone secondaire
Add-DnsServerPrimaryZone -Name "microdown.local" -ZoneFile "microdown.local.dns"
Add-DnsServerForwarder -IPAddress 9.9.9.9 -PassThru # Forward
# Add records
Add-DnsServerResourceRecordA -Name "srv-01" -ZoneName "asrc.local" -IPv4Address "192.168.8.1" -TimeToLive 01:00:00 -CreatePTR
Add-DnsServerResourceRecordA -Name "srv-02" -ZoneName "asrc.local" -IPv4Address "192.168.8.2" -TimeToLive 01:00:00 -CreatePTR
Add-DnsServerResourceRecordA -Name "srv-03" -ZoneName "asrc.local" -IPv4Address "192.168.128.1" -TimeToLive 01:00:00 -CreatePTR
Add-DnsServerResourceRecord -ZoneName "asrc.local" -NS -Name asrc.local -Nameserver "srv-03.asrc.local."
Add-DnsServerResourceRecord -ZoneName "168.192.in-addr.arpa" -NS -Name 168.192.in-addr.arpa -Nameserver "srv-03.asrc.local." ## UNSURE
#Add-DnsServerResourceRecord -ZoneName "asrc.local" -A -Name dev.asrc.local -IPv4Address "192.168.128.1"
Add-DnsServerZoneTransferPolicy -Name "asrc.local" -Action IGNORE -ServerInterfaceIP "ne,192.168.128.1" -PassThru -ZoneName "asrc.local"
Add-DnsServerZoneTransferPolicy -Name "168.192.in-addr.arpa" -Action IGNORE -ServerInterfaceIP "ne,192.168.128.1" -PassThru -ZoneName "168.192.in-addr.arpa"
#Add-DnsServerZoneDelegation -Name "asrc.local" -ChildZoneName "dev" -NameServer "srv-03.asrc.local." -IPAddress 192.168.128.1 -PassThru -Verbose
Add-DnsServerResourceRecordA -Name "SRV-01" -ZoneName "microdown.local" -IPv4Address "192.168.8.1" -TimeToLive 01:00:00
Add-DnsServerResourceRecordA -Name "SRV-02" -ZoneName "microdown.local" -IPv4Address "192.168.8.2" -TimeToLive 01:00:00
Add-DnsServerResourceRecordA -Name "NAT" -ZoneName "microdown.local" -IPv4Address "192.168.255.254" -TimeToLive 01:00:00
Test-DnsServer -IPAddress 192.168.8.1 -ZoneName "www.darty.fr" #Test
# Add local DNS for all Hosts
echo "Add local DNS for all Hosts"
Get-DhcpServerv4Scope | Set-DhcpServerv4OptionValue -DnsServer 192.168.8.1
Get-DhcpServerv4Scope | Set-DhcpServerv4OptionValue -DnsServer 192.168.128.1
# Add BGINFO autostart
C:\Program Files\BGINFO\Bginfo64.exe mescouilles2.bgi /all /nolicprompt
Read-Host "Finished?"
Restart-Computer

View File

@ -1,69 +0,0 @@
# Alexandre Simao
# GPL v3
# SRV-02 ONLY
# asrc.local domain
# TODO: Delegation
echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman"
### Rename this piece of garbage
echo "Changing Computer's name"
Rename-computer "SRV-02"
# End
### Rename interfaces by parsing VM device name
echo "Renaming adapters"
$adapts = Get-NetAdapter
foreach ($adapt in $adapts) {
$HVName = (Get-NetAdapterAdvancedProperty -name $adapt.name -DisplayName "Hyper-v Network Adapter Name").DisplayValue
Rename-Netadapter -name $adapt.name -NewName $HVName
}
#End
# Pausing to let things settle
echo "Sleeping 10s"
Sleep 10
### Général IP configure
# echo "IP configuration"
#Arc-SRV
netsh interface ip set address name="Arc-SRV" static 192.168.8.2 255.255.255.0 192.168.8.254
### DNS Conf for all InterfaceAlias ###
echo "DNS Conf"
foreach ($c in Get-NetAdapter) { write-host 'Setting DNS for' $c.interfaceName ; Set-DnsClientServerAddress -InterfaceIndex $c.interfaceindex -ServerAddresses ('192.168.8.1,192.168.128.1') }
### Install the DHCP role (Management tools if you love Metrosexual UI)
echo "Installing DHCP role"
Install-WindowsFeature DHCP -IncludeManagementTools
#END
### Setting connection as Private
echo "Setting connection as Private"
Set-NetConnectionProfile -NetworkCategory Private
### Change ZoneAlarm rule to accept incoming ICMP ipv4 probes
echo "Allowing ICMPv4 probes"
$Params = @{
"Name" = 'vm-monitoring-icmpv4'
"Action" = 'Allow'
}
Set-NetFirewallRule @Params
# END
Read-Host "Finished?"
Restart-Computer

View File

@ -1,143 +1,91 @@
# Alexandre Simao
# GPL v3
# SRV-03 ONLY
# asrc.dev,asrc.local,dev.asrc.local
# TODO:
echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman"
### Rename this piece of garbage
echo "Changing Computer's name"
Rename-computer "SRV-03"
# End
### Rename interfaces by parsing VM device name
echo "Renaming adapters"
$adapts = Get-NetAdapter
foreach ($adapt in $adapts) {
$HVName = (Get-NetAdapterAdvancedProperty -name $adapt.name -DisplayName "Hyper-v Network Adapter Name").DisplayValue
Rename-Netadapter -name $adapt.name -NewName $HVName
}
#End
# Pausing to let things settle
echo "Sleeping 10s"
Sleep 10
### Général IP configure
# echo "IP configuration"
#Arc-SRV
netsh interface ip set address name="Bou-LAN" static 192.168.128.1 255.255.255.0 192.168.128.254
### DNS Conf for all InterfaceAlias ###
echo "DNS Conf"
foreach ($c in Get-NetAdapter) { write-host 'Setting DNS for' $c.interfaceName ; Set-DnsClientServerAddress -InterfaceIndex $c.interfaceindex -ServerAddresses ('192.168.8.1') }
### Setting connection as Private
echo "Setting connection as Private"
Set-NetConnectionProfile -NetworkCategory Private
### Change ZoneAlarm rule to accept incoming ICMP ipv4 probes
echo "Allowing ICMPv4 probes"
$Params = @{
"Name" = 'vm-monitoring-icmpv4'
"Action" = 'Allow'
}
Set-NetFirewallRule @Params
# END
### Add routes for RTR-03
echo "Add routes for RTR-03"
route add -p 192.168.8.0/24 192.168.128.254
route add -p 192.168.12.0/24 192.168.128.254
route add -p 192.168.255.0/24 192.168.128.254
route add -p 0.0.0.0/0 192.168.128.254
# END
### Installing and configuring DNS role
# Install and configure DNS server
Install-WindowsFeature -Name DNS -IncludeManagementTools -includeallsubfeature
#Add-DnsServerPrimaryZone -NetworkID 192.168.128.0/24 -ZoneFile “192.168.128.1.in-addr.arpa.dns” # Zone secondaire
#Create asrc.dev
Add-DnsServerPrimaryZone -ResponsiblePerson "bol@loc.ks" -DynamicUpdate None -ZoneFile asrc.dev.dns -Name asrc.dev
Set-DnsServerPrimaryZone -ComputerName SRV-03 -Name asrc.dev -SecureSecondaries "NoTransfer"
$ns = Get-DnsServerResourceRecord -ZoneName asrc.dev -RRType NS
$nsnew = $ns.Clone()
$nsnew.RecordData.NameServer = "srv-03.asrc.local"
Set-DnsServerResourceRecord -ZoneName asrc.dev -NewInputObject $nsnew -OldInputObject $ns
$soa = Get-DnsServerResourceRecord -ZoneName asrc.dev -RRType Soa
$soanew = $soa.Clone()
$soanew.RecordData.PrimaryServer = "srv-03.asrc.local"
$soanew.RecordData.ExpireLimit = (New-TimeSpan -Days 4)
Set-DnsServerResourceRecord -ZoneName asrc.dev -NewInputObject $soanew -OldInputObject $soa
#Create dev.asrc.local
Add-DnsServerPrimaryZone -ResponsiblePerson "bol@loc.ks" -DynamicUpdate None -ZoneFile dev.asrc.local.dns -Name dev.asrc.local
Set-DnsServerPrimaryZone -ComputerName SRV-03 -Name dev.asrc.local -SecureSecondaries "NoTransfer"
#Create reverse lookup Zone
Add-DnsServerPrimaryZone -NetworkID "192.168.0.0/16" -Zonefile "168.192.in-addr.arpa.dns"
Add-DnsServerSecondaryZone -NetworkID "192.168.0.0/16" -Zonefile "168.192.in-addr.arpa.dns" -MasterServers 192.168.8.1
#Rename SOA+NS Direct
$ns = Get-DnsServerResourceRecord -ZoneName dev.asrc.local -RRType NS
$nsnew = $ns.Clone()
$nsnew.RecordData.NameServer = "srv-03.asrc.local"
Set-DnsServerResourceRecord -ZoneName dev.asrc.local -NewInputObject $nsnew -OldInputObject $ns
$soa = Get-DnsServerResourceRecord -ZoneName dev.asrc.local -RRType Soa
$soanew = $soa.Clone()
$soanew.RecordData.PrimaryServer = "srv-03.asrc.local"
$soanew.RecordData.ExpireLimit = (New-TimeSpan -Days 4)
Set-DnsServerResourceRecord -ZoneName dev.asrc.local -NewInputObject $soanew -OldInputObject $soa
Add-DnsServerForwarder -IPAddress 9.9.9.9 -PassThru # Forward
Add-DnsServerResourceRecordA -Name "SRV-03" -ZoneName "dev.asrc.local" -IPv4Address "192.168.128.1" -TimeToLive 01:00:00
Add-DnsServerResourceRecordA -Name "SRV-03" -ZoneName "asrc.dev" -IPv4Address "192.168.128.1" -TimeToLive 01:00:00
#Add DNS secondary zone for asrc.local
Add-DnsServerSecondaryZone -Name "asrc.local" -ZoneFile "asrc.local.dns" -MasterServers 192.168.8.1
Start-DnsServerZoneTransfer -Name "asrc.local" -Fulltransfer
Read-Host "Finished?"
Restart-Computer
# Alexandre Simao
# GPL v3
# SRV-01 ONLY
# Microdown.local domain
# TODO:
echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman"
### Rename this piece of garbage
echo "Changing Computer's name"
Rename-computer "SRV-03"
# End
### Rename interfaces by parsing VM device name
echo "Renaming adapters"
$adapts = Get-NetAdapter
foreach ($adapt in $adapts) {
$HVName = (Get-NetAdapterAdvancedProperty -name $adapt.name -DisplayName "Hyper-v Network Adapter Name").DisplayValue
Rename-Netadapter -name $adapt.name -NewName $HVName
}
#End
# Pausing to let things settle
echo "Sleeping 10s"
Sleep 10
### Général IP configure
# echo "IP configuration"
#Arc-SRV
netsh interface ip set address name="Bou-LAN" static 192.168.128.1 255.255.255.0 192.168.128.254
### DNS Conf for all InterfaceAlias ###
echo "DNS Conf"
foreach ($c in Get-NetAdapter) { write-host 'Setting DNS for' $c.interfaceName ; Set-DnsClientServerAddress -InterfaceIndex $c.interfaceindex -ServerAddresses ('192.168.8.1') }
### Setting connection as Private
echo "Setting connection as Private"
Set-NetConnectionProfile -NetworkCategory Private
### Change ZoneAlarm rule to accept incoming ICMP ipv4 probes
echo "Allowing ICMPv4 probes"
$Params = @{
"Name" = 'vm-monitoring-icmpv4'
"Action" = 'Allow'
}
Set-NetFirewallRule @Params
# END
### Add routes for RTR-01
echo "Add routes for RTR-01"
route add -p 192.168.12.0/24 192.168.128.254
route add -p 192.168.255.0/24 192.168.128.254
route add -p 0.0.0.0/0 192.168.128.254
# END
### Installing and configuring DNS role
# Install and configure DNS server
#Install-WindowsFeature -Name DNS -IncludeManagementTools -includeallsubfeature#
#Add-DnsServerPrimaryZone -NetworkID 192.168.8.0/24 -ZoneFile “192.168.8.1.in-addr.arpa.dns” # Zone secondaire
#Add-DnsServerPrimaryZone -Name "microdown.local" -ZoneFile "microdown.local.dns"
#Add-DnsServerForwarder -IPAddress 9.9.9.9 -PassThru # Forward
#Add-DnsServerResourceRecordA -Name "SRV-01" -ZoneName "microdown.local" -IPv4Address "192.168.8.1" -TimeToLive 01:00:00
#Add-DnsServerResourceRecordA -Name "SRV-02" -ZoneName "microdown.local" -IPv4Address "192.168.8.2" -TimeToLive 01:00:00
#Add-DnsServerResourceRecordA -Name "NAT" -ZoneName "microdown.local" -IPv4Address "192.168.255.254" -TimeToLive 01:00:00
#Test-DnsServer -IPAddress 192.168.8.1 -ZoneName "www.darty.fr" #Test
# Add BGINFO autostart
C:\Program Files\BGINFO\Bginfo64.exe mescouilles2.bgi /all /nolicprompt
Read-Host "Finished?"
Restart-Computer

11
Guests/WAN.conf Normal file
View File

@ -0,0 +1,11 @@
pushd routing ip relay
Install
set global loglevel = ERROR
add dhcpserver 192.168.8.1
set interface name = "WAN" relaymode = enable maxhop = 6 minsecs = 6
popd

View File

@ -1,17 +0,0 @@
Stop-VM RTR* -turnoff
Stop-VM SRV* -turnoff
Remove-VM RTR* -Force
Remove-VM SRV* -Force
#Dismount-VHD Path d:\VHD\SRV-01.vhdx
#Dismount-VHD Path d:\VHD\SRV-02.vhdx
#Dismount-VHD Path d:\VHD\SRV-03.vhdx
#Dismount-VHD Path d:\VHD\RTR-01.vhdx
#Dismount-VHD Path d:\VHD\RTR-02.vhdx
#Dismount-VHD Path d:\VHD\RTR-03.vhdx
#Dismount-VHD Path d:\VHD\CLI-01.vhdx
#Dismount-VHD Path d:\VHD\CLI-02.vhdx
#Dismount-VHD Path d:\VHD\CLI-03.vhdx
del d:\VHD\RTR*
del d:\VHD\SRV*

View File

@ -1,6 +0,0 @@
New-Item -Path "d:\" -Name "VHD" -ItemType "directory"
New-Item -Path "d:\" -Name "VM" -ItemType "directory"
New-Item -Path "d:\VHD" -Name "Base" -ItemType "directory"
Move-Item d:/sources d:/VHD/
New-VHD -ParentPath d:\VHD\source\Base_2016_14393.161220_StdGUI_G2_upd28022017.vhdx -Path d:\VHD\Base\Base_SRV_diff.vhdx -Differencing
New-VHD -ParentPath d:\VHD\source\Master_Win10_20h2_x86_G1.vhdx -Path d:\VHD\Base\Base_CLI_diff.vhdx -Differencing

View File

@ -1,82 +1,74 @@
## Tool to automate VM creation
echo "Shamefully made by Alexandre Simao. Pardon-me dear M. Stallman"
echo "GPLv3"
### Considered as finished. Need improvement VM side.
### Adding CLI-01
echo "Adding and configuring CLI-01"
cp D:\VHD\Base\Base_Client_dif.vhdx D:\VHD\CLI-01.vhdx
Mount-VHD d:\VHD\CLI-01.vhdx
<<<<<<< HEAD
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
>>>>>>> DNS
#mkdir e:\Tools\Scripts
#Copy-item d:\Scripts\Guests\CLI-01.ps1 E:\Tools\scripts
mkdir "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\bginfox86.bat "f:\Users\AdminLocal\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
Dismount-VHD d:\VHD\CLI-01.vhdx
$vms = @{
Name = "CLI-01"
Generation = '1'
MemoryStartupBytes = 1024Mb
VHDPath = "d:\VHD\CLI-01.vhdx"
SwitchName = "Arc-CLI"
}
New-VM @vms
Set-VMMemory CLI-01 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
Set-VM -Name CLI-01 -ProcessorCount 2
echo "Configuring adapters"
Rename-VMNetworkAdapter -VMName 'CLI-01' -NewName 'Arc-CLI'
### Adding and configuring CLI-03
echo "Adding and configuring CLI-03"
cp D:\VHD\Base\Base_Client_dif.vhdx D:\VHD\CLI-03.vhdx
Mount-VHD d:\VHD\CLI-03.vhdx
<<<<<<< HEAD
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
>>>>>>> DNS
#mkdir e:\Tools\Scripts
#Copy-item d:\Scripts\Guests\CLI-03.ps1 E:\Tools\scripts
mkdir "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\bginfox86.bat "f:\Users\AdminLocal\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
Dismount-VHD d:\VHD\CLI-03.vhdx
$vms = @{
Name = "CLI-03"
Generation = '1'
MemoryStartupBytes = 1024Mb
VHDPath = "d:\VHD\CLI-03.vhdx"
SwitchName = "Bou-LAN"
}
New-VM @vms
Set-VMMemory CLI-03 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
Set-VM -Name CLI-03 -ProcessorCount 2
echo "Configuring adapters"
#Set-VMNetworkAdapter -VMNetworkAdapter $vmadapter[0] -Name "Bou-LAN" -DeviceNaming on
Rename-VMNetworkAdapter -VMName 'CLI-03' -NewName 'Bou-LAN'
### Starting VMS
echo "Starting VMs"
Start-VM -Name CLI*
## Tool to automate VM creation
echo "Shamefully made by Alexandre Simao. Pardon-me dear M. Stallman"
echo "GPLv3"
### Considered as finished. Need improvement VM side.
### Adding CLI-01
echo "Adding and configuring CLI-01"
cp D:\VHD\Base\Base_Client_dif.vhdx D:\VHD\CLI-01.vhdx
Mount-VHD d:\VHD\CLI-01.vhdx
Copy-Item d:\Unattend\Fullunattend-Win10.xml -Destination f:\Windows\Panther\Unattend.xml
#mkdir e:\Tools\Scripts
#Copy-item d:\Scripts\Guests\CLI-01.ps1 E:\Tools\scripts
mkdir "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\bginfox86.bat "f:\Users\AdminLocal\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
Dismount-VHD d:\VHD\CLI-01.vhdx
$vms = @{
Name = "CLI-01"
Generation = '1'
MemoryStartupBytes = 1024Mb
VHDPath = "d:\VHD\CLI-01.vhdx"
SwitchName = "Arc-CLI"
}
New-VM @vms
Set-VMMemory CLI-01 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
Set-VM -Name CLI-01 -ProcessorCount 2
echo "Configuring adapters"
Rename-VMNetworkAdapter -VMName 'CLI-01' -NewName 'Arc-CLI'
### Adding and configuring CLI-03
echo "Adding and configuring CLI-03"
cp D:\VHD\Base\Base_Client_dif.vhdx D:\VHD\CLI-03.vhdx
Mount-VHD d:\VHD\CLI-03.vhdx
Copy-Item d:\Unattend\Fullunattend-Win10.xml -Destination f:\Windows\Panther\Unattend.xml
#mkdir e:\Tools\Scripts
#Copy-item d:\Scripts\Guests\CLI-03.ps1 E:\Tools\scripts
mkdir "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\bginfox86.bat "f:\Users\AdminLocal\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
Dismount-VHD d:\VHD\CLI-03.vhdx
$vms = @{
Name = "CLI-03"
Generation = '1'
MemoryStartupBytes = 1024Mb
VHDPath = "d:\VHD\CLI-03.vhdx"
SwitchName = "Bou-LAN"
}
New-VM @vms
Set-VMMemory CLI-03 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
Set-VM -Name CLI-03 -ProcessorCount 2
echo "Configuring adapters"
#Set-VMNetworkAdapter -VMNetworkAdapter $vmadapter[0] -Name "Bou-LAN" -DeviceNaming on
Rename-VMNetworkAdapter -VMName 'CLI-03' -NewName 'Bou-LAN'
### Starting VMS
echo "Starting VMs"
Start-VM -Name CLI*

View File

@ -1,100 +0,0 @@
### 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-02
echo "Adding and configuring SRV-02"
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\SRV-02.vhdx
$Lettre = Mount-VHD -Path "d:\VHD\SRV-02.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-02.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"
Dismount-VHD d:\VHD\SRV-02.vhdx
$vms = @{
Name = "SRV-02"
Generation = '2'
MemoryStartupBytes = 1024Mb
VHDPath = "d:\VHD\SRV-02.vhdx"
SwitchName = "Arc-SRV"
}
New-VM @vms
Set-VMMemory SRV-02 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
Set-VM -Name SRV-02 -ProcessorCount 2
echo "Configuring adapters"
Rename-VMNetworkAdapter -VMName 'SRV-02' -NewName 'Arc-SRV'
Set-VMNetworkAdapter -VMName 'SRV-02' -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*

View File

@ -1,4 +1,4 @@
Stop-VM CLI* -turnoff
Remove-VM CLI* -Force
del d:\VHD\CLI*
Stop-VM CLI* -turnoff
Remove-VM CLI* -Force
del d:\VHD\CLI*

7
Host/Kill-Serv.ps1 Normal file
View File

@ -0,0 +1,7 @@
Stop-VM RTR* -turnoff
Stop-VM SRV* -turnoff
Remove-VM RTR* -Force
Remove-VM SRV* -Force
del d:\VHD\RTR*
del d:\VHD\SRV*

View File

@ -1,3 +0,0 @@
Stop-VM SRV* -turnoff
Remove-VM SRV* -Force
del d:\VHD\SRV*

View File

@ -5,23 +5,19 @@ echo "GPLv3"
### Considered as finished. Need improvement VM side.
### Define vars
$scripts_path = d:\scripts
### 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 ${scripts_path}\Guests\SRV-01.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"
Mount-VHD d:\VHD\SRV-01.vhdx
Copy-Item d:\Unattend\server.xml -Destination e:\Windows\Panther\Unattend.xml
mkdir e:\Tools\Scripts
mkdir "e:\Program Files\BGINFO"
Copy-item d:\Scripts\Guests\SRV-01.ps1 E:\Tools\scripts\boot.ps1
Copy-Item D:\Soft\BGInfo_Deploiement\BGInfo64.exe "e:\Program Files\BGINFO\"
Copy-Item D:\Soft\BGInfo_Deploiement\mescouilles2.bgi "e:\Program Files\BGINFO\"
Copy-Item D:\Soft\BGInfo_Deploiement\bginfo.bat "e:\Program Files\BGINFO\"
Dismount-VHD d:\VHD\SRV-01.vhdx
$vms = @{
@ -46,15 +42,15 @@ Set-VMNetworkAdapter -VMName 'SRV-01' -Name "Arc-SRV" -DeviceNaming on
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 ${scripts_path}\Guests\SRV-03.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"
Dismount-VHD d:\VHD\SRV-03.vhdx
Mount-VHD d:\VHD\SRV-03.vhdx
Copy-Item d:\Unattend\server.xml -Destination e:\Windows\Panther\Unattend.xml
mkdir e:\Tools\Scripts
mkdir "e:\Program Files\BGINFO"
Copy-item d:\Scripts\Guests\SRV-03.ps1 E:\Tools\scripts\boot.ps1
Copy-Item D:\Soft\BGInfo_Deploiement\BGInfo64.exe "e:\Program Files\BGINFO\"
Copy-Item D:\Soft\BGInfo_Deploiement\mescouilles2.bgi "e:\Program Files\BGINFO\"
Copy-Item D:\Soft\BGInfo_Deploiement\bginfo.bat "e:\Program Files\BGINFO\"
Dismount-VHD d:\VHD\SRV-01.vhdx
$vms = @{
@ -63,31 +59,29 @@ $vms = @{
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
Rename-VMNetworkAdapter -VMName 'SRV-03' -NewName 'Arc-SRV'
Set-VMNetworkAdapter -VMName 'SRV-03' -Name "Arc-SRV" -DeviceNaming on
### Adding and configuring RTR-01
echo "Adding and configuring RTR-01"
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-01.vhdx
$Lettre = Mount-VHD -Path "d:\VHD\RTR-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 ${scripts_path}\Guests\RTR-01.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"
Mount-VHD d:\VHD\RTR-01.vhdx
Copy-Item d:\Unattend\server.xml -Destination e:\Windows\Panther\Unattend.xml
mkdir e:\Tools\Scripts
mkdir "e:\Program Files\BGINFO"
Copy-item d:\Scripts\Guests\RTR-01.ps1 E:\Tools\scripts\boot.ps1
Copy-Item D:\Soft\BGInfo_Deploiement\BGInfo64.exe "e:\Program Files\BGINFO\"
Copy-Item D:\Soft\BGInfo_Deploiement\mescouilles2.bgi "e:\Program Files\BGINFO\"
Copy-Item D:\Soft\BGInfo_Deploiement\bginfo.bat "e:\Program Files\BGINFO\"
Dismount-VHD d:\VHD\RTR-01.vhdx
$vms = @{
@ -116,15 +110,14 @@ Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "WAN" -Name "WAN" -DeviceNamin
echo "Adding and configuring RTR-02"
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-02.vhdx
$Lettre = Mount-VHD -Path "d:\VHD\RTR-02.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"
>>>>>>> parent of ca6ee46 (Feat: Add VNetwork creation)
mkdir "${Driveletter}:\Tools\Scripts"
Copy-item ${scripts_path}\Guests\RTR-02.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"
Mount-VHD d:\VHD\RTR-02.vhdx
Copy-Item d:\Unattend\server.xml -Destination e:\Windows\Panther\Unattend.xml
mkdir e:\Tools\Scripts
mkdir "e:\Program Files\BGINFO"
Copy-item D:\scripts\Guests\RTR-02.ps1 E:\Tools\scripts\boot.ps1
Copy-Item D:\Soft\BGInfo_Deploiement\BGInfo64.exe "e:\Program Files\BGINFO\"
Copy-Item D:\Soft\BGInfo_Deploiement\mescouilles2.bgi "e:\Program Files\BGINFO\"
Copy-Item D:\Soft\BGInfo_Deploiement\bginfo.bat "e:\Program Files\BGINFO\"
Dismount-VHD d:\VHD\RTR-02.vhdx
$vms = @{
@ -153,14 +146,14 @@ Add-VMNetworkAdapter -VMName "RTR-02" -SwitchName "WAN" -Name "WAN" -DeviceNamin
echo "Adding and configuring RTR-03"
cp D:\VHD\Base\Base_SRV_diff.vhdx D:\VHD\RTR-03.vhdx
$Lettre = Mount-VHD -Path "d:\VHD\RTR-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 ${scripts_path}\Guests\RTR-03.ps1 "${Driveletter}:\Tools\scripts\boot.ps1"
Mount-VHD d:\VHD\RTR-03.vhdx
Copy-Item d:\Unattend\server.xml -Destination e:\Windows\Panther\Unattend.xml
mkdir e:\Tools\Scripts
mkdir "e:\Program Files\BGINFO"
Copy-item d:\Scripts\Guests\RTR-03.ps1 E:\Tools\scripts\boot.ps1
Copy-Item D:\Soft\BGInfo_Deploiement\BGInfo64.exe "e:\Program Files\BGINFO\"
Copy-Item D:\Soft\BGInfo_Deploiement\mescouilles2.bgi "e:\Program Files\BGINFO\"
Copy-Item D:\Soft\BGInfo_Deploiement\bginfo.bat "e:\Program Files\BGINFO\"
Dismount-VHD d:\VHD\RTR-03.vhdx
$vms = @{
@ -186,11 +179,9 @@ Add-VMNetworkAdapter -VMName "RTR-03" -SwitchName "Aston" -Name "Aston" -DeviceN
echo "Starting VMs"
Start-VM -Name RTR*
### Sleeping 15s
echo "Sleeping 15s"
Sleep 15
### Sleeping 30s
echo "Sleeping 30"
Sleep 30
Start-VM -Name SRV*

View File

@ -60,30 +60,3 @@ Rename-Netadapter -name $adapt.name -NewName $HWName
### Set DNS Server on client
Set-DnsClientServerAddress -InterfaceIndex 7 -ServerAddresses ("10.152.0.6", "10.152.0.7")
### DNS avec variables via https://www.sapien.com/forums/viewtopic.php?t=14700
$DomainNames = 'CorporateProduct1.com'
$PrimaryDNSServer = 'PRDSVRDNS01-VM'
$SecondaryDNSServer1 = 'PRDSVRDNS02-VM'
$SecondaryDNSServer2 = 'PRDSVRDNS03-VM'
#Create Primary DNS Forward Lookup Zone
Add-DnsServerPrimaryZone -ComputerName $PrimaryDNSServer -Name $DomainNames -ZoneFile $DomainNames.dns -DynamicUpdate None -ResponsiblePerson "domains.$($ENV:USERDNSDOMAIN.ToLower())"
Set-DnsServerPrimaryZone -ComputerName $PrimaryDNSServer -Name $DomainNames -SecureSecondaries "TransferToSecureServers" -SecondaryServers "$([System.Net.Dns]::GetHostAddresses($SecondaryDNSServer1).IPAddressToString)", "$([System.Net.Dns]::GetHostAddresses($SecondaryDNSServer2).IPAddressToString)"
# Set the Public DNS servers to replicate to
Add-DnsServerResourceRecord -ComputerName $PrimaryDNSServer -Name '@' -ZoneName $DomainNames -NS -NameServer "ns1.$ENV:USERDNSDOMAIN"
Add-DnsServerResourceRecord -ComputerName $PrimaryDNSServer -Name '@' -ZoneName $DomainNames -NS -NameServer "ns2.$ENV:USERDNSDOMAIN"
Add-DnsServerResourceRecord -ComputerName $PrimaryDNSServer -Name '@' -ZoneName $DomainNames -NS -NameServer "ns3.$ENV:USERDNSDOMAIN"
#Let the Forward lookup zones created completely
Start-Sleep -Seconds 5
#Replicate the Forwardlookup zones into two additional Public DNS servers
Add-DnsServerSecondaryZone -ComputerName $SecondaryDNSServer1 -MasterServers [System.Net.Dns]::GetHostAddresses($PrimaryDNSServer).IPAddressToString -Name $DomainNames -ZoneFile "$DomainNames.dns"
Add-DnsServerSecondaryZone -ComputerName $SecondaryDNSServer2 -MasterServers [System.Net.Dns]::GetHostAddresses($PrimaryDNSServer).IPAddressToString -Name $DomainNames -ZoneFile "$DomainNames.dns"
Get-WindowsCapability -name "*RSAT*" -online|Add-WindowsCapability -online

64
OLD/RTR-02_OLD.ps1 Normal file
View File

@ -0,0 +1,64 @@
# Alexandre SIMAO
# GPLv3
# Script to install and configure a Fuckdows Server 2016 as a router
# RTR-02 Only
echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman"
# Change the poor machine name
Rename-computer "RTR-02"
Rename-NetAdapter -Name "Ethernet" -NewName "Bou-LAN"
Rename-NetAdapter -Name "Ethernet 2" -NewName "WAN"
netsh interface ip set address "WAN" static 192.168.255.8 255.255.255.0 192.168.255.254
netsh interface ip set address "Bou-LAN" static 192.168.128.254 255.255.255.0
netsh interface ip set dns name="WAN" static 9.9.9.9.
# Install Routing and necessary linked roles
Install-WindowsFeature RemoteAccess, RSAT-RemoteAccess-PowerShell, Routing -IncludeManagementTools
set-service RemoteAccess -StartupType Automatic
Start-Service RemoteAccess
# Display interfaces and active forwarding for all of thm via Regedit
netsh inter show inter
Set-NetConnectionProfile -NetworkCategory Private
$Params = @{
"Name" = 'vm-monitoring-icmpv4'
"Action" = 'Allow'
}
Set-NetFirewallRule @Params
# Activate NAT and DHCP Relay
netsh routing ip relay install
netsh routing ip add interface name="WAN" state=enable
netsh routing ip relay add interface "WAN"
netsh rout ip rel set int ARC-CLI min=0
netsh routing ip relay add interface "Bou-LAN"
netsh rout ip rel set int ARC-SRV min=0
netsh -f ./Bou-LAN.conf
# Change ZoneAlarm rule to accept incoming ICMP ipv4 probes
$Params = @{
"Name" = 'vm-monitoring-icmpv4'
"Action" = 'Allow'
}
Set-NetFirewallRule @Params
# Add routes
route add -p 192.168.8.0/24 192.168.255.8
route add -p 192.168.12.0.24 192.168.255.8
route add -p 192.168.255.0/24 192.168.255.128
route add -p 192.168.128.0/24 192.168.128.254
route add -p 0.0.0.0/0 192.168.255.254

47
OLD/RTR-03_Old.ps1 Normal file
View File

@ -0,0 +1,47 @@
# Alexandre SIMAO
# GPLv3
### TODO ?
# Script to install and configure a Fuckdows Server 2016 as a router
# RTR-03 Only
echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman"
# Change the poor machine name
Rename-computer "RTR-03"
Rename-NetAdapter -Name "Ethernet" -NewName "WAN"
Rename-NetAdapter -Name "Ethernet 2" -NewName "Aston"
# Install Routing and necessary linked roles
Install-WindowsFeature RemoteAccess, RSAT-RemoteAccess-PowerShell, Routing -IncludeManagementTools
set-service RemoteAccess -StartupType Automatic
Start-Service RemoteAccess
netsh interface ip set address "WAN" static 192.168.255.254 255.255.255.0
netsh interface ip set dns name="WAN" static 9.9.9.9
# Activate NAT
netsh routing ip nat install
netsh routing ip nat add interface name="WAN" mode=PRIVATE
netsh routing ip nat add interface name="Aston" mode=FULL
# Change ZoneAlarm rule to accept incoming ICMP ipv4 probes
$Params = @{
"Name" = 'vm-monitoring-icmpv4'
"Action" = 'Allow'
}
Set-NetFirewallRule @Params
Set-NetConnectionProfile -networkcategory private
# Add routes
route add -p 192.168.8.0/24 192.168.255.8
route add -p 192.168.12.0/24 192.168.255.8
route add -p 192.168.128.0/24 192.168.255.128
route add -p 192.168.255.0/24 192.168.255.254

View File

@ -1,31 +0,0 @@
# Aston Hyper-V code snipets
## Introduction
As a student at Aston Informatic School we mainly, and until now, exclusively studies Microsoft products.
Because I like to tinker, you'll find here some tools to put an infra in place.
For the moment, no Ansible, no Chef-Infra, no Terraform; no nice feature at all. I hope to resolve that later.
To achieve this ambitious goal, i'll use mainly PowerShell scripts.
## Usage
First of all, here be dragons.
The host folder contain all scripts needed for deploying the infra.
* Bootstrap-Hyper-V.ps1 copy the necessary files (diff disks etc) on the desired folders. It will configure automaticaly all aspects to launch VMs on this atrocious Hyper-v.`v1`
* Create-ALL.ps1 create all VMs with adequate parameters to comply with the school pre-defined infrastructure. It consist on 2 server on a separate network that does AD, DNS, DHCP for one and nothing for the other at the time.`v1`
* Create-SRV.ps1 creates only the poor servers, fixed parameters for the moment.
* Create-CLI.ps1 create only the cursed client, same ase Create-SRV.ps1.
* SRV-Kill.ps1 cease the suffering of the servers.
* ALL-Kill.ps1 cease all the travesty of infrastructure.
## TODO
* Integrate SRV-02 creation and role definition.
* Variable isinde Create-SRV.ps1, Create-CLI.ps1.
* Unmount disk on Kill scripts.
## Credit roll
* Sorry to the free-software community for, in a way, increasing the radiance of the Microsoft "hegemony"
* Richard M. Stallman for his work and his wise teachings
* Sylvain Arrambourg, for his teachings and patience.
* Well, of course my familly, beloved ones and my cat.
* Go to hell Microsoft, may you eternally burn and take with you corporate greed and private code.
## Licence
GPLv3 my dudes!

View File

@ -1,4 +0,0 @@
SRV-01 reverse lookup
Add SRV-03 as NS in reverse lookup
Add Reverse lookup on SRV-03
Fix reverse lookup zone transfer from SRV-01

View File

@ -1,66 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>*</ComputerName>
<RegisteredOrganization>Aston Ecole</RegisteredOrganization>
<RegisteredOwner>Aston Ecole</RegisteredOwner>
<ShowWindowsLive>false</ShowWindowsLive>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>fr-fr</InputLocale>
<SystemLocale>fr-fr</SystemLocale>
<UILanguage>fr-fr</UILanguage>
<UserLocale>fr-fr</UserLocale>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RegisteredOrganization>Aston Ecole</RegisteredOrganization>
<RegisteredOwner>Aston Ecole</RegisteredOwner>
<UserAccounts>
<AdministratorPassword>
<Value>Pa$$w0rd</Value>
<PlainText>True</PlainText>
</AdministratorPassword>
</UserAccounts>
<AutoLogon>
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>True</PlainText>
</Password>
<Domain>.</Domain>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>Administrateur</Username>
</AutoLogon>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>c:\conf\deploy.cmd</CommandLine>
<Description>Post Install Script</Description>
<Order>1</Order>
</SynchronousCommand>
</FirstLogonCommands>
<OOBE>
<HideEULAPage>true</HideEULAPage>
</OOBE>
<Display>
<ColorDepth>32</ColorDepth>
<HorizontalResolution>1024</HorizontalResolution>
<VerticalResolution>768</VerticalResolution>
</Display>
</component>
</settings>
<settings pass="generalize">
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>1</SkipRearm>
</component>
<component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DoNotOpenServerManagerAtLogon>false</DoNotOpenServerManagerAtLogon>
</component>
<component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
</component>
</settings>
<cpi:offlineImage cpi:source="catalog:c:/users/maintenance/documents/clg/install_windows server 2008 r2 serverstandard.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>*</ComputerName>
<RegisteredOrganization>Aston Ecole</RegisteredOrganization>
<RegisteredOwner>Aston Ecole</RegisteredOwner>
<ShowWindowsLive>false</ShowWindowsLive>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>fr-fr</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UILanguage>en-us</UILanguage>
<UserLocale>en-us</UserLocale>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RegisteredOrganization>Aston Ecole</RegisteredOrganization>
<RegisteredOwner>Aston Ecole</RegisteredOwner>
<UserAccounts>
<AdministratorPassword>
<Value>Pa$$w0rd</Value>
<PlainText>True</PlainText>
</AdministratorPassword>
</UserAccounts>
<AutoLogon>
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>True</PlainText>
</Password>
<Domain>.</Domain>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>Administrateur</Username>
</AutoLogon>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>c:\conf\deploy.cmd</CommandLine>
<Description>Post Install Script</Description>
<Order>1</Order>
</SynchronousCommand>
</FirstLogonCommands>
<OOBE>
<HideEULAPage>true</HideEULAPage>
</OOBE>
<Display>
<ColorDepth>32</ColorDepth>
<HorizontalResolution>1024</HorizontalResolution>
<VerticalResolution>768</VerticalResolution>
</Display>
</component>
</settings>
<settings pass="generalize">
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>1</SkipRearm>
</component>
<component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DoNotOpenServerManagerAtLogon>false</DoNotOpenServerManagerAtLogon>
</component>
<component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
</component>
</settings>
<cpi:offlineImage cpi:source="catalog:c:/users/maintenance/documents/clg/install_windows server 2008 r2 serverstandard.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

View File

@ -1,151 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>040c:0000040c</InputLocale>
<SystemLocale>fr-FR</SystemLocale>
<UILanguage>fr-FR</UILanguage>
<UILanguageFallback>fr-FR</UILanguageFallback>
<UserLocale>fr-FR</UserLocale>
</component>
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>040c:0000040c</InputLocale>
<SystemLocale>fr-FR</SystemLocale>
<UILanguage>fr-FR</UILanguage>
<UILanguageFallback>fr-FR</UILanguageFallback>
<UserLocale>fr-FR</UserLocale>
</component>
<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
<component name="Microsoft-Windows-SQMApi" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CEIPEnabled>0</CEIPEnabled>
</component>
<component name="Microsoft-Windows-SQMApi" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CEIPEnabled>0</CEIPEnabled>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>MYCOMPUTER</ComputerName>
<!--
<ProductKey>W269N-WFGWX-YVC9B-4J6C9-T83GX</ProductKey>
-->
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>MYCOMPUTER</ComputerName>
<!--
<ProductKey>W269N-WFGWX-YVC9B-4J6C9-T83GX</ProductKey>
-->
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AutoLogon>
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>AdminLocal</Username>
</AutoLogon>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Home</NetworkLocation>
<SkipUserOOBE>true</SkipUserOOBE>
<SkipMachineOOBE>true</SkipMachineOOBE>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Description>AdminLocal</Description>
<DisplayName>AdminLocal</DisplayName>
<Group>Administrators</Group>
<Name>AdminLocal</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<RegisteredOrganization></RegisteredOrganization>
<RegisteredOwner>Aston Ecole</RegisteredOwner>
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Description>Control Panel View</Description>
<Order>1</Order>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 0 /f</CommandLine>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Control Panel Icon Size</Description>
<RequiresUserInput>false</RequiresUserInput>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 1 /f</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
<TimeZone>Romance Standard Time</TimeZone>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AutoLogon>
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>AdminLocal</Username>
</AutoLogon>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Home</NetworkLocation>
<SkipUserOOBE>true</SkipUserOOBE>
<SkipMachineOOBE>true</SkipMachineOOBE>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Description>AdminLocal</Description>
<DisplayName>AdminLocal</DisplayName>
<Group>Administrators</Group>
<Name>AdminLocal</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<RegisteredOrganization></RegisteredOrganization>
<RegisteredOwner>Aston Ecole</RegisteredOwner>
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Description>Control Panel View</Description>
<Order>1</Order>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 0 /f</CommandLine>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Control Panel Icon Size</Description>
<RequiresUserInput>false</RequiresUserInput>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 1 /f</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
<TimeZone>Romance Standard Time</TimeZone>
</component>
</settings>
</unattend>
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>040c:0000040c</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UILanguage>en-us</UILanguage>
<UILanguageFallback>en-us</UILanguageFallback>
<UserLocale>en-us</UserLocale>
</component>
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>040c:0000040c</InputLocale>
<SystemLocale>fr-FR</SystemLocale>
<UILanguage>fr-FR</UILanguage>
<UILanguageFallback>fr-FR</UILanguageFallback>
<UserLocale>fr-FR</UserLocale>
</component>
<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
<component name="Microsoft-Windows-SQMApi" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CEIPEnabled>0</CEIPEnabled>
</component>
<component name="Microsoft-Windows-SQMApi" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CEIPEnabled>0</CEIPEnabled>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>MYCOMPUTER</ComputerName>
<!--
<ProductKey>W269N-WFGWX-YVC9B-4J6C9-T83GX</ProductKey>
-->
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>MYCOMPUTER</ComputerName>
<!--
<ProductKey>W269N-WFGWX-YVC9B-4J6C9-T83GX</ProductKey>
-->
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AutoLogon>
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>AdminLocal</Username>
</AutoLogon>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Home</NetworkLocation>
<SkipUserOOBE>true</SkipUserOOBE>
<SkipMachineOOBE>true</SkipMachineOOBE>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Description>AdminLocal</Description>
<DisplayName>AdminLocal</DisplayName>
<Group>Administrators</Group>
<Name>AdminLocal</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<RegisteredOrganization></RegisteredOrganization>
<RegisteredOwner>Aston Ecole</RegisteredOwner>
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Description>Control Panel View</Description>
<Order>1</Order>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 0 /f</CommandLine>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Control Panel Icon Size</Description>
<RequiresUserInput>false</RequiresUserInput>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 1 /f</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
<TimeZone>Romance Standard Time</TimeZone>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AutoLogon>
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>AdminLocal</Username>
</AutoLogon>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Home</NetworkLocation>
<SkipUserOOBE>true</SkipUserOOBE>
<SkipMachineOOBE>true</SkipMachineOOBE>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Description>AdminLocal</Description>
<DisplayName>AdminLocal</DisplayName>
<Group>Administrators</Group>
<Name>AdminLocal</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<RegisteredOrganization></RegisteredOrganization>
<RegisteredOwner>Aston Ecole</RegisteredOwner>
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Description>Control Panel View</Description>
<Order>1</Order>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 0 /f</CommandLine>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Control Panel Icon Size</Description>
<RequiresUserInput>false</RequiresUserInput>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 1 /f</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
<TimeZone>Romance Standard Time</TimeZone>
</component>
</settings>
<cpi:offlineImage cpi:source="" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

152
Unattend/client.xml Normal file
View File

@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>040c:0000040c</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UILanguage>en-us</UILanguage>
<UILanguageFallback>en-us</UILanguageFallback>
<UserLocale>en-us</UserLocale>
</component>
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>040c:0000040c</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UILanguage>en-us</UILanguage>
<UILanguageFallback>fr-FR</UILanguageFallback>
<UserLocale>en-us</UserLocale>
</component>
<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
<component name="Microsoft-Windows-SQMApi" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CEIPEnabled>0</CEIPEnabled>
</component>
<component name="Microsoft-Windows-SQMApi" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CEIPEnabled>0</CEIPEnabled>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>MYCOMPUTER</ComputerName>
<!--
<ProductKey>W269N-WFGWX-YVC9B-4J6C9-T83GX</ProductKey>
-->
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>MYCOMPUTER</ComputerName>
<!--
<ProductKey>W269N-WFGWX-YVC9B-4J6C9-T83GX</ProductKey>
-->
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AutoLogon>
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>AdminLocal</Username>
</AutoLogon>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Home</NetworkLocation>
<SkipUserOOBE>true</SkipUserOOBE>
<SkipMachineOOBE>true</SkipMachineOOBE>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Description>AdminLocal</Description>
<DisplayName>AdminLocal</DisplayName>
<Group>Administrators</Group>
<Name>AdminLocal</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<RegisteredOrganization></RegisteredOrganization>
<RegisteredOwner>Bollocks Corp</RegisteredOwner>
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Description>Control Panel View</Description>
<Order>1</Order>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 0 /f</CommandLine>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Control Panel Icon Size</Description>
<RequiresUserInput>false</RequiresUserInput>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 1 /f</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
<TimeZone>Romance Standard Time</TimeZone>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AutoLogon>
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>AdminLocal</Username>
</AutoLogon>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Home</NetworkLocation>
<SkipUserOOBE>true</SkipUserOOBE>
<SkipMachineOOBE>true</SkipMachineOOBE>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>Pa$$w0rd</Value>
<PlainText>true</PlainText>
</Password>
<Description>AdminLocal</Description>
<DisplayName>AdminLocal</DisplayName>
<Group>Administrators</Group>
<Name>AdminLocal</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<RegisteredOrganization></RegisteredOrganization>
<RegisteredOwner>Bollocks Corp</RegisteredOwner>
<DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Description>Control Panel View</Description>
<Order>1</Order>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 0 /f</CommandLine>
<RequiresUserInput>true</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<Description>Control Panel Icon Size</Description>
<RequiresUserInput>false</RequiresUserInput>
<CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 1 /f</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
<TimeZone>Romance Standard Time</TimeZone>
</component>
</settings>
<cpi:offlineImage cpi:source="" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

77
Unattend/server.xml Normal file
View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RunAsynchronous>
<RunAsynchronousCommand wcm:action="add">
<Credentials>
<Username>Administrateur</Username>
<Password>Pa$$w0rd</Password>
</Credentials>
<Description>Script to install roles</Description>
<Order>1</Order>
<Path>powershell -File &quot;C:\Tools\scripts\boot.ps1&quot;</Path>
</RunAsynchronousCommand>
</RunAsynchronous>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>fr-fr</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UILanguage>en-us</UILanguage>
<UserLocale>en-us</UserLocale>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RegisteredOrganization>Bollocks Corp</RegisteredOrganization>
<RegisteredOwner>Bollocks Corp</RegisteredOwner>
<UserAccounts>
<AdministratorPassword>
<Value>UABhACQAJAB3ADAAcgBkAEEAZABtAGkAbgBpAHMAdAByAGEAdABvAHIAUABhAHMAcwB3AG8AcgBkAA==</Value>
<PlainText>false</PlainText>
</AdministratorPassword>
</UserAccounts>
<AutoLogon>
<Domain>.</Domain>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>Administrateur</Username>
<Password>
<Value>UABhACQAJAB3ADAAcgBkAFAAYQBzAHMAdwBvAHIAZAA=</Value>
<PlainText>false</PlainText>
</Password>
</AutoLogon>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>c:\conf\deploy.cmd</CommandLine>
<Description>Post Install Script</Description>
<Order>1</Order>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<Order>2</Order>
<CommandLine>powershell -File &quot;C:\tools\scripts\boot.ps1&quot;</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
<OOBE>
<HideEULAPage>true</HideEULAPage>
</OOBE>
<Display>
<ColorDepth>32</ColorDepth>
<HorizontalResolution>1024</HorizontalResolution>
<VerticalResolution>768</VerticalResolution>
</Display>
</component>
</settings>
<settings pass="generalize">
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>1</SkipRearm>
</component>
<component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DoNotOpenServerManagerAtLogon>false</DoNotOpenServerManagerAtLogon>
</component>
<component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
</component>
</settings>
<cpi:offlineImage cpi:source="wim:d:/wim/server-2016.wim#W2016_x64" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

View File

@ -1,3 +0,0 @@
powershell c:\Tools\scripts\boot.ps1
start c:\bginfo\startup.cmd
start c:\bginfo\bginfo.cmd

View File

@ -1,2 +0,0 @@
$cul = "tamere"
d:\scripts\temp\2.ps1

View File

@ -1 +0,0 @@
echo $cul