diff --git a/Guests/MACS/MACSRV-01.txt b/Guests/MACS/MACSRV-01.txt deleted file mode 100644 index 09f4f68..0000000 Binary files a/Guests/MACS/MACSRV-01.txt and /dev/null differ diff --git a/Guests/MACS/temp.txt b/Guests/MACS/temp.txt deleted file mode 100644 index f2ef42a..0000000 Binary files a/Guests/MACS/temp.txt and /dev/null differ diff --git a/Guests/MACS/test.csv b/Guests/MACS/test.csv deleted file mode 100644 index ba2ef05..0000000 --- a/Guests/MACS/test.csv +++ /dev/null @@ -1,8 +0,0 @@ -"ClassId2e4f51ef21dd47e99d3c952918aff9cd","pageHeaderEntry","pageFooterEntry","autosizeInfo","shapeInfo","groupingEntry" -"033ecb2bc07a4d43b5ef94ed5a35d280",,,,"Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo", -"9e210fe47d09416682b841769c78b8a3",,,,, -"27c87ef9bbda4f709f6b4002fa4af63c",,,,, -"27c87ef9bbda4f709f6b4002fa4af63c",,,,, -"27c87ef9bbda4f709f6b4002fa4af63c",,,,, -"4ec4f0187cb04f4cb6973460dfe252df",,,,, -"cf522b78d86c486691226b40aa69e95c",,,,, diff --git a/Guests/RTR-01.ps1 b/Guests/RTR-01.ps1 index 15735a3..90aaa73 100644 --- a/Guests/RTR-01.ps1 +++ b/Guests/RTR-01.ps1 @@ -17,6 +17,9 @@ $HVName = (Get-NetAdapterAdvancedProperty -name $adapt.name -DisplayName "Hyper- Rename-Netadapter -name $adapt.name -NewName $HVName } +echo "Sleeping 30s" +Sleep 30 + #Général IP configure $MaskBits = 24 # This means subnet mask = 255.255.255.0 diff --git a/Guests/RTR-02.ps1 b/Guests/RTR-02.ps1 index 6a35e5d..1cb32cb 100644 --- a/Guests/RTR-02.ps1 +++ b/Guests/RTR-02.ps1 @@ -17,6 +17,9 @@ $HVName = (Get-NetAdapterAdvancedProperty -name $adapt.name -DisplayName "Hyper- Rename-Netadapter -name $adapt.name -NewName $HVName } +echo "Sleeping 30s" +Sleep 30 + #Général IP configure $MaskBits = 24 # This means subnet mask = 255.255.255.0 diff --git a/Guests/RTR-03.ps1 b/Guests/RTR-03.ps1 index 1eeaad9..f66b8ce 100644 --- a/Guests/RTR-03.ps1 +++ b/Guests/RTR-03.ps1 @@ -14,9 +14,12 @@ Rename-computer RTR-03 $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 +Rename-Netadapter -name "$adapt.name" -NewName "$HVName" } +echo "Sleeping 30s" +Sleep 30 + #Général IP configure $MaskBits = 24 # This means subnet mask = 255.255.255.0 diff --git a/Guests/SRV-01_DHCP.ps1 b/Guests/SRV-01_DHCP.ps1 index 6f4294a..64cce4f 100644 --- a/Guests/SRV-01_DHCP.ps1 +++ b/Guests/SRV-01_DHCP.ps1 @@ -18,11 +18,15 @@ $HVName = (Get-NetAdapterAdvancedProperty -name $adapt.name -DisplayName "Hyper- Rename-Netadapter -name $adapt.name -NewName $HVName } +echo "Sleeping 30s" +Sleep 30 + # Set IP for pre-defined MAC addresses +#Arc-SRV + $adapter = Get-NetAdapter | ? {$_.Name -eq "Arc-SRV"} -#Arc-SRV $IP = "192.168.8.1" $MaskBits = 24 # This means subnet mask = 255.255.255.0 $Gateway = "192.168.8.254" @@ -32,7 +36,16 @@ $adapter | New-NetIPAddress ` -AddressFamily $IPType ` -IPAddress $IP ` -PrefixLength $MaskBits ` - -DefaultGateway $Gateway + -DefaultGateway 192.168.8.255 + + + + $adapter = Get-NetAdapter | ? {$_.Name -eq "Arc-CLI"} + $IP = "192.168.12.254" + $adapter | New-NetIPAddress ` + -AddressFamily $IPType ` + -IPAddress $IP ` + -PrefixLength $MaskBits ` # Set DNS @@ -95,11 +108,11 @@ route add -p 0.0.0.0/0 192.168.8.254 # Change DHCP server options -Set-DhcpServerv4OptionValue -ScopeId 192.168.128.0 -OptionID 3 -Value 192.168.128.254 +Set-DhcpServerv4OptionValue -ScopeId 192.168.128.0 -OptionID 3 -Value 192.168.128.254 -DnsServer 9.9.9.9 Set-DhcpServerv4OptionValue -ScopeId 192.168.128.0 -DnsServer 9.9.9.9 -Set-DhcpServerv4OptionValue -ScopeId 192.168.12.0 -OptionID 3 -Value 192.168.12.254 -Set-DhcpServerv4OptionValue -ScopeId 192.168.12.0 -DnsServer 9.9.9.9 -Set-DhcpServerv4OptionValue -ScopeId 192.168.8.0 -OptionID 3 -Value 192.168.8.254 +Set-DhcpServerv4OptionValue -ScopeId 192.168.12.0 -OptionID 3 -Value 192.168.12.254 -DnsServer 9.9.9.9 +Set-DhcpServerv4OptionValue -ScopeId 192.168.12.0 +Set-DhcpServerv4OptionValue -ScopeId 192.168.8.0 -OptionID 3 -Value 192.168.8.254 -DnsServer 9.9.9.9 Set-DhcpServerv4OptionValue -ScopeId 192.168.8.0 -DnsServer 9.9.9.9 Read-Host "Finished" diff --git a/Host/Infra-Standard.ps1 b/Host/Infra-Standard.ps1 index f40b0ca..e3a28e2 100644 --- a/Host/Infra-Standard.ps1 +++ b/Host/Infra-Standard.ps1 @@ -18,11 +18,14 @@ $vms = @{ Name = "SRV-01" Generation = '2' MemoryStartupBytes = 1024Mb - VHDPath = "d:\VHD\$VMName.vhdx" + VHDPath = "d:\VHD\SRV-01.vhdx" + } New-VM @vms Set-VMMemory SRV-01 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB +Set-VM -Name SRV-01 -ProcessorCount 2 + $vmadapter = Get-VMNetworkAdapter -VMName "SRV-01" Add-VMNetworkAdapter -VMName "SRV-01" -SwitchName "Arc-SRV" -Name "Arc-SRV" -DeviceNaming on @@ -40,10 +43,13 @@ $vms = @{ Generation = '2' MemoryStartupBytes = 1024Mb VHDPath = "d:\VHD\RTR-01.vhdx" + } New-VM @vms Set-VMMemory RTR-01 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB +Set-VM -Name RTR-01 -ProcessorCount 2 + $vmadapter = Get-VMNetworkAdapter -VMName "RTR-01" #Set-VMNetworkAdapter -VMNetworkAdapter $vmadapter[0] -Name "Arc-SRV" -DeviceNaming on Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "Arc-CLI" -Name "Arc-Cli" -DeviceNaming on @@ -63,12 +69,14 @@ $vms = @{ Name = "RTR-02" Generation = '2' MemoryStartupBytes = 1024Mb - VHDPath = "d:\VHD\$VMName.vhdx" + VHDPath = "d:\VHD\RTR-02.vhdx" + } New-VM @vms -Set-VMMemory RTR-03 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB +Set-VMMemory RTR-02 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB +Set-VM -Name RTR-02 -ProcessorCount 2 $vmadapter = Get-VMNetworkAdapter -VMName "RTR-02" Add-VMNetworkAdapter -VMName "RTR-02" -SwitchName "Bou-LAN" -Name "Bou-LAN" -DeviceNaming on @@ -89,12 +97,14 @@ $vms = @{ Name = "RTR-03" Generation = '2' MemoryStartupBytes = 1024Mb - VHDPath = "d:\VHD\$VMName.vhdx" + VHDPath = "d:\VHD\RTR-03.vhdx" + } New-VM @vms Set-VMMemory RTR-03 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB +Set-VM -Name RTR-03 -ProcessorCount 2 $vmadapter = Get-VMNetworkAdapter -VMName "RTR-03" Add-VMNetworkAdapter -VMName "RTR-03" -SwitchName "Aston" -Name "Aston" -DeviceNaming on diff --git a/Host/Kill-VM.ps1 b/Host/Kill-VM.ps1 new file mode 100644 index 0000000..7a67010 --- /dev/null +++ b/Host/Kill-VM.ps1 @@ -0,0 +1,7 @@ +Stop-VM RTR* -turnoff +Stop-VM SRV* -turnoff +Remove-VM RTR* +Remove-VM SRV* + +del d:\VHD\RTR* +del d:\VHD\SRV* diff --git a/Guests/RTR-02_OLD.ps1 b/OLD/RTR-02_OLD.ps1 similarity index 100% rename from Guests/RTR-02_OLD.ps1 rename to OLD/RTR-02_OLD.ps1 diff --git a/Guests/RTR-03_Old.ps1 b/OLD/RTR-03_Old.ps1 similarity index 100% rename from Guests/RTR-03_Old.ps1 rename to OLD/RTR-03_Old.ps1