
5 changed files with 121 additions and 0 deletions
@ -0,0 +1,69 @@
|
||||
# Alexandre Simao |
||||
# GPL v3 |
||||
|
||||
# SRV-02 ONLY |
||||
# asrc.local domain |
||||
|
||||
# TODO: Delegation |
||||
|
||||
echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman" |
||||
|
||||
### Rename this piece of garbage |
||||
|
||||
echo "Changing Computer's name" |
||||
Rename-computer "SRV-02" |
||||
# End |
||||
|
||||
### Rename interfaces by parsing VM device name |
||||
|
||||
echo "Renaming adapters" |
||||
$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 |
||||
} |
||||
#End |
||||
|
||||
# Pausing to let things settle |
||||
|
||||
echo "Sleeping 10s" |
||||
Sleep 10 |
||||
|
||||
### Général IP configure |
||||
# echo "IP configuration" |
||||
|
||||
#Arc-SRV |
||||
|
||||
netsh interface ip set address name="Arc-SRV" static 192.168.8.2 255.255.255.0 192.168.8.254 |
||||
|
||||
### 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 ('192.168.8.1,192.168.128.1') } |
||||
|
||||
### Install the DHCP role (Management tools if you love Metrosexual UI) |
||||
|
||||
echo "Installing DHCP role" |
||||
Install-WindowsFeature DHCP -IncludeManagementTools |
||||
|
||||
#END |
||||
|
||||
### Setting connection as Private |
||||
|
||||
echo "Setting connection as Private" |
||||
Set-NetConnectionProfile -NetworkCategory Private |
||||
|
||||
### Change ZoneAlarm rule to accept incoming ICMP ipv4 probes |
||||
|
||||
echo "Allowing ICMPv4 probes" |
||||
$Params = @{ |
||||
"Name" = 'vm-monitoring-icmpv4' |
||||
"Action" = 'Allow' |
||||
} |
||||
|
||||
Set-NetFirewallRule @Params |
||||
# END |
||||
|
||||
|
||||
Read-Host "Finished?" |
||||
Restart-Computer |
@ -0,0 +1,6 @@
|
||||
New-Item -Path "d:\" -Name "VHD" -ItemType "directory" |
||||
New-Item -Path "d:\" -Name "VM" -ItemType "directory" |
||||
New-Item -Path "d:\VHD" -Name "Base" -ItemType "directory" |
||||
Move-Item d:/sources d:/VHD/ |
||||
New-VHD -ParentPath d:\VHD\source\Base_2016_14393.161220_StdGUI_G2_upd28022017.vhdx -Path d:\VHD\Base\Base_SRV_diff.vhdx -Differencing |
||||
New-VHD -ParentPath d:\VHD\source\Master_Win10_20h2_x86_G1.vhdx -Path d:\VHD\Base\Base_CLI_diff.vhdx -Differencing |
Loading…
Reference in new issue