Deploy Active Directory Domain using PowerShell Let’s start by Setting the PowerShell Execution Policy to Unrestricted
|
Set-ExecutionPolicy Unrestricted |
Next we will rename the server and install Prereq features.
|
<strong>#rename the computer</strong> $newname = “LAB-DC-01” Rename-Computer -NewName $newname -force< <strong>#install features</strong> $featureLogPath = “c:\softlib\Shell\poshlog\featurelog.txt” New-Item $featureLogPath -ItemType file -Force $addsTools = “RSAT-AD-Tools” Add-WindowsFeature $addsTools Get-WindowsFeature | Where installed >>$featureLogPath <strong>#restart the computer</strong> Restart-Computer |
After the script has run successfully the sever will restart , once restarted launch the #PowerShell Console again and run the second script. This will install all…