Skip to main content
Version: Next

Task 12: Complete Combined Script (All Steps)

Runbook Phase 03 Platform

Status: Active | Estimated Time: 15–20 minutes | Last Updated: 2026-03-04


Overview

Optional combined script that runs Tasks 02–10 in a single execution. Use this instead of running each task individually if preferred.

info

Task 11 (Clear Previous Storage Configuration) is not included — it is conditional and must be run separately if needed.

WinRM Prerequisite

Task 01 (Enable WinRM) must be completed on each node before running the orchestrated script. Run it manually via console or SConfig first.


Prerequisites

RequirementDetails
Task 01 complete on all nodesWinRM enabled via console/SConfig
variables.yml populatedAll node IPs, hostnames, network values set

Variables from variables.yml

PathTypeDescription
cluster_nodes[].management_ipstringStatic IP per node
cluster_nodes[].hostnamestringTarget hostname per node
network.management.gatewaystringDefault gateway
network.management.prefix_lengthintegerSubnet prefix
dns.primarystringPrimary DNS server
dns.secondarystringSecondary DNS server
cluster.management_nic_namestringManagement adapter name
active_directory.ntp_serversarrayNTP server addresses

Run locally on each node. Set all REPLACE_ variables before running.

# Task 12 - Complete Combined Script (direct, run on each node)
# Set all REPLACE_ variables before running

$StaticIP = "REPLACE_WITH_STATIC_IP" # cluster_nodes[].management_ip
$Gateway = "REPLACE_WITH_GATEWAY" # network.management.gateway
$PrefixLength = 24 # network.management.prefix
$DNSPrimary = "REPLACE_WITH_DNS_PRIMARY" # dns.primary
$DNSSecondary = "REPLACE_WITH_DNS_SECONDARY" # dns.secondary
$NTPServer = "REPLACE_WITH_NTP_SERVER" # ntp.server
$NewHostname = "REPLACE_WITH_HOSTNAME" # cluster_nodes[].hostname

if ($StaticIP -match "^REPLACE_" -or $NewHostname -match "^REPLACE_") {
Write-Host "Set all REPLACE_ variables before running" -ForegroundColor Red; exit 1
}

# Task 02 - Enable RDP
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"

# Tasks 03-04 - Static IP / Disable DHCP
$adapter = Get-NetAdapter | Where-Object { $_.Status -eq "Up" } | Select-Object -First 1
Set-NetIPInterface -InterfaceIndex $adapter.ifIndex -Dhcp Disabled
Get-NetIPAddress -InterfaceIndex $adapter.ifIndex -AddressFamily IPv4 -ErrorAction SilentlyContinue | Remove-NetIPAddress -Confirm:$false
New-NetIPAddress -InterfaceIndex $adapter.ifIndex -IPAddress $StaticIP -PrefixLength $PrefixLength -DefaultGateway $Gateway

# Task 05 - DNS
Set-DnsClientServerAddress -InterfaceIndex $adapter.ifIndex -ServerAddresses @($DNSPrimary, $DNSSecondary)

# Task 07 - NTP
w32tm /config /manualpeerlist:$NTPServer /syncfromflags:manual /update | Out-Null
Restart-Service w32time
w32tm /resync | Out-Null

# Task 08 - ICMP
Enable-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)"

# Task 09 - Disable unused adapters
Get-NetAdapter | Where-Object { $_.Status -eq "Disconnected" } | Disable-NetAdapter -Confirm:$false
Get-NetAdapter | Format-Table Name, Status, LinkSpeed -AutoSize

# Task 10 - Hostname
Rename-Computer -NewName $NewHostname -Force

Write-Host "Restart required to apply hostname change."
Write-Host -NoNewline "Restart now? [Y/N]: "; if ((Read-Host) -match "^[Yy]") { Restart-Computer -Force }

Validation Checklist

  • All nodes restarted successfully
  • Hostnames match variables.yml
  • Static IPs set and DHCP disabled
  • DNS resolves correctly
  • NTP synchronized
  • ICMP responds from all nodes

Troubleshooting

IssueCauseResolution
Script fails on one node but succeeds on othersWinRM connectivity issue or credential mismatchVerify Enter-PSSession -ComputerName <node> works; re-run Enable-PSRemoting -Force on the failing node
Hostname not changed after rebootRename-Computer requires a restart to take effectConfirm the script includes -Restart flag; manually reboot if needed: Restart-Computer -Force
Static IP not appliedDHCP still enabled on the management adapterRun Set-NetIPInterface -InterfaceAlias "Management" -Dhcp Disabled before assigning the static IP
DNS resolution fails after configurationDNS server addresses not set or wrong orderVerify with Get-DnsClientServerAddress; re-run the DNS configuration step with correct IPs from variables.yml

← Task 11: Clear Storage · ↑ Phase 03