last commit

This commit is contained in:
Winston Smith 2021-04-22 15:58:53 +02:00
parent c9073c4459
commit 29329438df
11 changed files with 50 additions and 19 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,8 +0,0 @@
"ClassId2e4f51ef21dd47e99d3c952918aff9cd","pageHeaderEntry","pageFooterEntry","autosizeInfo","shapeInfo","groupingEntry"
"033ecb2bc07a4d43b5ef94ed5a35d280",,,,"Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo",
"9e210fe47d09416682b841769c78b8a3",,,,,
"27c87ef9bbda4f709f6b4002fa4af63c",,,,,
"27c87ef9bbda4f709f6b4002fa4af63c",,,,,
"27c87ef9bbda4f709f6b4002fa4af63c",,,,,
"4ec4f0187cb04f4cb6973460dfe252df",,,,,
"cf522b78d86c486691226b40aa69e95c",,,,,
1 ClassId2e4f51ef21dd47e99d3c952918aff9cd pageHeaderEntry pageFooterEntry autosizeInfo shapeInfo groupingEntry
2 033ecb2bc07a4d43b5ef94ed5a35d280 Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo
3 9e210fe47d09416682b841769c78b8a3
4 27c87ef9bbda4f709f6b4002fa4af63c
5 27c87ef9bbda4f709f6b4002fa4af63c
6 27c87ef9bbda4f709f6b4002fa4af63c
7 4ec4f0187cb04f4cb6973460dfe252df
8 cf522b78d86c486691226b40aa69e95c

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

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

@ -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*