branch init

This commit is contained in:
Alex 2021-04-21 16:02:07 +02:00
parent 7499c37bff
commit 5438f331e7
4 changed files with 11 additions and 4 deletions

View File

@ -11,6 +11,7 @@ echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman"
Rename-computer RTR-01 Rename-computer RTR-01
$adapter = Get-NetAdapter | ? {$_.MacAddress -eq "00-15-5D-02-70-00"} $adapter = Get-NetAdapter | ? {$_.MacAddress -eq "00-15-5D-02-70-00"}
Rename-NetAdapter -Name "Eth*" -NewName "Arc-SRV"
#Arc-SRV #Arc-SRV
$IP = "192.168.8.1" $IP = "192.168.8.1"

View File

@ -3,8 +3,8 @@
# SRV-01 ONLY # SRV-01 ONLY
# TODO : exclusion/attribution fields # TODO : exclusion/attribution fields
# Rename interfaces # Rename interfaces
# #
echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman" echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman"
#Rename this piece of garbage #Rename this piece of garbage

View File

@ -49,8 +49,8 @@ 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
$vmadapter = Get-VMNetworkAdapter -VMName "RTR-01" $vmadapter = Get-VMNetworkAdapter -VMName "RTR-01"
Set-VMNetworkAdapter -VMNetworkAdapter $vmadapter[0] -StaticMacAddress 00155D027001 Set-VMNetworkAdapter -VMNetworkAdapter $vmadapter[0] -StaticMacAddress 00155D027001
Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "Arc-CLI" -StaticMacAddress 00155D027002 Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "Arc-CLI"
Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "WAN" -StaticMacAddress 00155D027003 Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "WAN"
# RTR-02 # RTR-02

View File

@ -33,3 +33,9 @@ Get-VMNetworkAdapter -VMName "Virtual 2008 1" | Where-Object -Property MacAddres
Get-NetAdapter |Where-Object {$_.MacAddress -eq 'XX-XX-XX-XX'} | Select-Object` Get-NetAdapter |Where-Object {$_.MacAddress -eq 'XX-XX-XX-XX'} | Select-Object`
-Property Name | Format-Table -HideTableHeaders -Property Name | Format-Table -HideTableHeaders
$adapts = Get-NetAdapter
foreach ($adapt in $adapts) {
$HWName = (Get-NetAdapterAdvancedProperty -name $adapt.name -DisplayName "Hyper-v Network Adapter Name").DisplayValue
Rename-Netadapter -name $adapt.name -NewName $HWName
}