Skip to content

Instantly share code, notes, and snippets.

@bunchc
Last active April 12, 2017 02:48
Show Gist options
  • Save bunchc/b7783fd220b5602cffc46158bac3099e to your computer and use it in GitHub Desktop.
Save bunchc/b7783fd220b5602cffc46158bac3099e to your computer and use it in GitHub Desktop.
Build and Populate Windows AD
$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