Start Auto-create and conf trials
This commit is contained in:
parent
29329438df
commit
bb2e9586fe
@ -17,8 +17,8 @@ $HVName = (Get-NetAdapterAdvancedProperty -name $adapt.name -DisplayName "Hyper-
|
|||||||
Rename-Netadapter -name $adapt.name -NewName $HVName
|
Rename-Netadapter -name $adapt.name -NewName $HVName
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Sleeping 30s"
|
echo "Sleeping 10s"
|
||||||
Sleep 30
|
Sleep 10
|
||||||
|
|
||||||
#Général IP configure
|
#Général IP configure
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ Rename-Netadapter -name $adapt.name -NewName $HVName
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "Sleeping 30s"
|
echo "Sleeping 30s"
|
||||||
Sleep 30
|
Sleep 10
|
||||||
|
|
||||||
#Général IP configure
|
#Général IP configure
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ Rename-Netadapter -name "$adapt.name" -NewName "$HVName"
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "Sleeping 30s"
|
echo "Sleeping 30s"
|
||||||
Sleep 30
|
Sleep 10
|
||||||
|
|
||||||
#Général IP configure
|
#Général IP configure
|
||||||
|
|
||||||
|
@ -12,14 +12,11 @@ Rename-computer "SRV-1"
|
|||||||
|
|
||||||
# Rename interfaces
|
# Rename interfaces
|
||||||
|
|
||||||
$adapts = Get-NetAdapter
|
$HVName = (Get-NetAdapterAdvancedProperty -name "Ethernet" -DisplayName "Hyper-v Network Adapter Name").DisplayValue
|
||||||
foreach ($adapt in $adapts) {
|
Rename-Netadapter -name Ethernet -NewName $HVName
|
||||||
$HVName = (Get-NetAdapterAdvancedProperty -name $adapt.name -DisplayName "Hyper-v Network Adapter Name").DisplayValue
|
|
||||||
Rename-Netadapter -name $adapt.name -NewName $HVName
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "Sleeping 30s"
|
echo "Sleeping 30s"
|
||||||
Sleep 30
|
Sleep 10
|
||||||
|
|
||||||
# Set IP for pre-defined MAC addresses
|
# Set IP for pre-defined MAC addresses
|
||||||
|
|
||||||
@ -29,7 +26,6 @@ $adapter = Get-NetAdapter | ? {$_.Name -eq "Arc-SRV"}
|
|||||||
|
|
||||||
$IP = "192.168.8.1"
|
$IP = "192.168.8.1"
|
||||||
$MaskBits = 24 # This means subnet mask = 255.255.255.0
|
$MaskBits = 24 # This means subnet mask = 255.255.255.0
|
||||||
$Gateway = "192.168.8.254"
|
|
||||||
$IPType = "IPv4"
|
$IPType = "IPv4"
|
||||||
|
|
||||||
$adapter | New-NetIPAddress `
|
$adapter | New-NetIPAddress `
|
||||||
@ -38,15 +34,6 @@ $adapter | New-NetIPAddress `
|
|||||||
-PrefixLength $MaskBits `
|
-PrefixLength $MaskBits `
|
||||||
-DefaultGateway 192.168.8.255
|
-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
|
# Set DNS
|
||||||
|
|
||||||
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 ('9.9.9.9') }
|
||||||
@ -108,11 +95,11 @@ route add -p 0.0.0.0/0 192.168.8.254
|
|||||||
|
|
||||||
# Change DHCP server options
|
# Change DHCP server options
|
||||||
|
|
||||||
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 -OptionID 3 -Value 192.168.128.254
|
||||||
Set-DhcpServerv4OptionValue -ScopeId 192.168.128.0 -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 -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
|
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 -DnsServer 9.9.9.9
|
Set-DhcpServerv4OptionValue -ScopeId 192.168.8.0 -OptionID 3 -Value 192.168.8.254
|
||||||
Set-DhcpServerv4OptionValue -ScopeId 192.168.8.0 -DnsServer 9.9.9.9
|
Set-DhcpServerv4OptionValue -ScopeId 192.168.8.0 -DnsServer 9.9.9.9
|
||||||
|
|
||||||
Read-Host "Finished"
|
Read-Host "Finished"
|
@ -19,15 +19,16 @@ $vms = @{
|
|||||||
Generation = '2'
|
Generation = '2'
|
||||||
MemoryStartupBytes = 1024Mb
|
MemoryStartupBytes = 1024Mb
|
||||||
VHDPath = "d:\VHD\SRV-01.vhdx"
|
VHDPath = "d:\VHD\SRV-01.vhdx"
|
||||||
|
SwitchName = "Arc-SRV"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
New-VM @vms
|
New-VM @vms
|
||||||
Set-VMMemory SRV-01 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
|
Set-VMMemory SRV-01 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
|
||||||
Set-VM -Name SRV-01 -ProcessorCount 2
|
Set-VM -Name SRV-01 -ProcessorCount 2
|
||||||
|
Rename-VMNetworkAdapter -VMName 'SRV-01' -NewName 'Arc-SRV'
|
||||||
|
Set-VMNetworkAdapter -VMName 'SRV-01' -Name "Arc-SRV" -DeviceNaming on
|
||||||
|
|
||||||
$vmadapter = Get-VMNetworkAdapter -VMName "SRV-01"
|
|
||||||
Add-VMNetworkAdapter -VMName "SRV-01" -SwitchName "Arc-SRV" -Name "Arc-SRV" -DeviceNaming on
|
|
||||||
|
|
||||||
# RTR-01
|
# RTR-01
|
||||||
|
|
||||||
@ -43,18 +44,19 @@ $vms = @{
|
|||||||
Generation = '2'
|
Generation = '2'
|
||||||
MemoryStartupBytes = 1024Mb
|
MemoryStartupBytes = 1024Mb
|
||||||
VHDPath = "d:\VHD\RTR-01.vhdx"
|
VHDPath = "d:\VHD\RTR-01.vhdx"
|
||||||
|
SwitchName = "Arc-SRV"
|
||||||
}
|
}
|
||||||
|
|
||||||
New-VM @vms
|
New-VM @vms
|
||||||
Set-VMMemory RTR-01 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
|
Set-VMMemory RTR-01 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
|
||||||
Set-VM -Name RTR-01 -ProcessorCount 2
|
Set-VM -Name RTR-01 -ProcessorCount 2
|
||||||
|
|
||||||
$vmadapter = Get-VMNetworkAdapter -VMName "RTR-01"
|
|
||||||
#Set-VMNetworkAdapter -VMNetworkAdapter $vmadapter[0] -Name "Arc-SRV" -DeviceNaming on
|
#Set-VMNetworkAdapter -VMNetworkAdapter $vmadapter[0] -Name "Arc-SRV" -DeviceNaming on
|
||||||
|
Rename-VMNetworkAdapter -VMName 'RTR-01' -NewName 'Arc-SRV'
|
||||||
|
Set-VMNetworkAdapter -VMName 'RTR-01' -Name "Arc-SRV" -DeviceNaming on
|
||||||
Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "Arc-CLI" -Name "Arc-Cli" -DeviceNaming on
|
Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "Arc-CLI" -Name "Arc-Cli" -DeviceNaming on
|
||||||
Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "WAN" -Name "WAN" -DeviceNaming on
|
Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "WAN" -Name "WAN" -DeviceNaming on
|
||||||
Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "Arc-SRV" -Name "Arc-SRV" -DeviceNaming on
|
|
||||||
|
|
||||||
# RTR-02
|
# RTR-02
|
||||||
|
|
||||||
@ -70,7 +72,7 @@ $vms = @{
|
|||||||
Generation = '2'
|
Generation = '2'
|
||||||
MemoryStartupBytes = 1024Mb
|
MemoryStartupBytes = 1024Mb
|
||||||
VHDPath = "d:\VHD\RTR-02.vhdx"
|
VHDPath = "d:\VHD\RTR-02.vhdx"
|
||||||
|
SwitchName = "Bou-LAN"
|
||||||
}
|
}
|
||||||
|
|
||||||
New-VM @vms
|
New-VM @vms
|
||||||
@ -78,11 +80,12 @@ New-VM @vms
|
|||||||
Set-VMMemory RTR-02 -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
|
Set-VM -Name RTR-02 -ProcessorCount 2
|
||||||
|
|
||||||
$vmadapter = Get-VMNetworkAdapter -VMName "RTR-02"
|
Rename-VMNetworkAdapter -VMName 'RTR-02' -NewName 'Bou-Lan'
|
||||||
Add-VMNetworkAdapter -VMName "RTR-02" -SwitchName "Bou-LAN" -Name "Bou-LAN" -DeviceNaming on
|
Set-VMNetworkAdapter -VMName 'RTR-02' -Name "Bou-LAN" -DeviceNaming on
|
||||||
Add-VMNetworkAdapter -VMName "RTR-02" -SwitchName "WAN" -Name "WAN" -DeviceNaming on
|
Add-VMNetworkAdapter -VMName "RTR-02" -SwitchName "WAN" -Name "WAN" -DeviceNaming on
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# RTR-03
|
# RTR-03
|
||||||
|
|
||||||
|
|
||||||
@ -98,7 +101,7 @@ $vms = @{
|
|||||||
Generation = '2'
|
Generation = '2'
|
||||||
MemoryStartupBytes = 1024Mb
|
MemoryStartupBytes = 1024Mb
|
||||||
VHDPath = "d:\VHD\RTR-03.vhdx"
|
VHDPath = "d:\VHD\RTR-03.vhdx"
|
||||||
|
SwitchName = "WAN"
|
||||||
}
|
}
|
||||||
|
|
||||||
New-VM @vms
|
New-VM @vms
|
||||||
@ -106,9 +109,10 @@ New-VM @vms
|
|||||||
Set-VMMemory RTR-03 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
|
Set-VMMemory RTR-03 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
|
||||||
Set-VM -Name RTR-03 -ProcessorCount 2
|
Set-VM -Name RTR-03 -ProcessorCount 2
|
||||||
|
|
||||||
$vmadapter = Get-VMNetworkAdapter -VMName "RTR-03"
|
Rename-VMNetworkAdapter -VMName 'RTR-03' -NewName 'WAN'
|
||||||
|
Set-VMNetworkAdapter -VMName 'RTR-03' -Name "WAN" -DeviceNaming on
|
||||||
Add-VMNetworkAdapter -VMName "RTR-03" -SwitchName "Aston" -Name "Aston" -DeviceNaming on
|
Add-VMNetworkAdapter -VMName "RTR-03" -SwitchName "Aston" -Name "Aston" -DeviceNaming on
|
||||||
Add-VMNetworkAdapter -VMName "RTR-03" -SwitchName "WAN" -Name "WAN" -DeviceNaming on
|
|
||||||
|
|
||||||
|
|
||||||
Start-VM -Name RTR*
|
Start-VM -Name RTR*
|
||||||
|
Loading…
Reference in New Issue
Block a user