diff --git a/Guests/SRV-01.ps1 b/Guests/SRV-01.ps1 index 632d7c0..ad91a0b 100644 --- a/Guests/SRV-01.ps1 +++ b/Guests/SRV-01.ps1 @@ -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 ('9.9.9.9') } +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) @@ -118,9 +118,7 @@ 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 -#Set-DhcpServerv4OptionValue -ScopeId 192.168.8.0 -DnsServer 9.9.9.9 - -Get-DhcpServerv4Scope | Set-DhcpServerv4OptionValue -DnsServer 9.9.9.9 +Get-DhcpServerv4Scope | Set-DhcpServerv4OptionValue -DnsServer 192.168.8.1 Read-Host "Finished?" Restart-Computer diff --git a/Host/Serveurs.ps1 b/Host/Serveurs.ps1 index 5ecba72..0cc94a8 100644 --- a/Host/Serveurs.ps1 +++ b/Host/Serveurs.ps1 @@ -34,6 +34,64 @@ 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 + +Mount-VHD d:\VHD\SRV-02.vhdx +Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination e:\Windows\Panther\Unattend.xml +Copy-Item D:\Scripts\deploy.cmd -Destination e:\conf\deploy.cmd +mkdir e:\Tools\Scripts +Copy-item d:\Scripts\Guests\SRV-02.ps1 E:\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 + +Mount-VHD d:\VHD\SRV-03.vhdx |Get-Disk +Copy-Item D:\Scripts\Unattend\FullUnattend-srv.xml -Destination e:\Windows\Panther\Unattend.xml +Copy-Item D:\Scripts\deploy.cmd -Destination e:\conf\deploy.cmd +mkdir e:\Tools\Scripts +#Copy-item d:\Scripts\Guests\SRV-03.ps1 E:\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 ### Adding and configuring RTR-01