Last active
April 12, 2017 02:48
-
-
Save bunchc/b7783fd220b5602cffc46158bac3099e to your computer and use it in GitHub Desktop.
Build and Populate Windows AD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$newDomainName="orangutan.local" | |
$newDomainNetBios="orangutan" | |
$csvZipURL="https://gist.githubusercontent.com/bunchc/b7783fd220b5602cffc46158bac3099e/raw/41dcdd1d2f5902f4c7238122dca6d6da9a38833b/CSV.zip" | |
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
Enable-RemoteDesktop | |
# Install some useful packages | |
cinst git | |
cinst git-credential-winstore | |
cinst console-devel | |
cinst sublimetext2 | |
cinst poshgit | |
cinst dotpeek | |
cinst putty | |
cinst winscp | |
# Enable AD | |
Install-WindowsFeature 'AD-Domain-Services' -IncludeAllSubFeature -IncludeManagementTools | |
# Installing ADDS Forest | |
Install-ADDSForest -DomainName $newDomainName -DomainNetbiosName $newDomainNetBios -SafeModeAdministratorPassword (ConvertTo-SecureString "P@ssword1" -AsPlainText -Force) -Force | |
# Pull down the script & CSV files needed to populate AD | |
wget $csvZipURL -OutFile "c:\CSV.zip" | |
Expand-Archive -Force c:\CSV.zip -DestinationPath c:\Populate-AD\ | |
# Populate AD | |
Set-ExecutionPolicy bypass | |
Set-Location "c:\Populate-AD\CSV\" | |
Invoke-Expression -command ".\Install-LabADObjects.ps1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment