##### DO NOT EDIT ##### Param( [string]$Step ) ##### DO NOT EDIT ##### if (($Step) -eq "1") { # Step 1 - Create working directory. Download and import PSM New-Item -type Directory C:\DPAutomation -Force Invoke-WebRequest http://toolkit.datapipe.net/BesTasks/anthony/WindowsPSM/DPWindowsPSM.psm1 -OutFile C:\DPAutomation\DPWindowsPSM.psm1 Import-Module C:\DPAutomation\DPWindowsPSM.psm1 -Force $Step = "2" } if (($Step) -eq "2") { # Step 2 - Add auto resume no logon keys. Rename the server and reboot $ServerName = "DC01" DPAddAutoResumeNoLogon -Command "powershell C:\DPAutomation\AWS2012NewForest.ps1 -Step 3" DPRenameServer -ServerName $ServerName Shutdown -R -T 0 } if (($Step) -eq "3") { # Step 3 - Remove auto resume. Add auto resume no logon keys. Set AWS NTP. Set AWS Timezone. Disable Windows FW. Enable multiple RDP. Patch. Reboot. Import-Module C:\DPAutomation\DPWindowsPSM.psm1 -Force DPAWSSetNTP DPAWSSetTimezone DPDisableWindowsFW DPEnableMultipleRDP DPInstallWindowsUpdates DPRemoveAutoResumeNoLogon DPAddAutoResumeNoLogon -Command "powershell C:\DPAutomation\AWS2012NewForest.ps1 -Step 4" Shutdown -R -T 0 } if (($Step) -eq "4") { # Step 4 - Remove autoresume. Install new 2012 forest. Set DNS servers. Remove soure. Reboot. Import-Module C:\DPAutomation\DPWindowsPSM.psm1 -Force DPADInstallNew2012Forest -DomainName test.local -ADRestorePassword P@ssw0rd DPSetDNSServers -BaseIP 10.1.0.31 -DNS1 127.0.0.1 -DNS2 8.8.8.8 DPRemoveAutoResumeNoLogon Powershell Remove-Item C:\DPAutomation\ -Recurse -Force Shutdown -R -T 0 }