Skip to content

Instantly share code, notes, and snippets.

@techbunny
Last active August 7, 2018 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techbunny/c87cbc6d9ac54a4b8ddd9c2178b9b28a to your computer and use it in GitHub Desktop.
Save techbunny/c87cbc6d9ac54a4b8ddd9c2178b9b28a to your computer and use it in GitHub Desktop.
User Creation
#Adds KDS Root Key with no delay. Use only with testing, will cause issue with more than one DC.
Add-KdsRootKey -EffectiveTime ((get-date).addhours(-10))
#Create a OU for Worker VMs and AD Group for Container Hosts
New-ADOrganizationalUnit "WorkerVMs"
New-ADGroup -GroupCategory Security -DisplayName "Container Hosts" -Name containerhosts -GroupScope Universal
$containerhosts = Get-ADGroup containerhosts
# Create some sample regular users if needed for future testing
New-ADUser -Name User1 -PasswordNeverExpires $true -AccountPassword ("Password123!" | ConvertTo-SecureString -AsPlainText -Force) -Enabled $true -UserPrincipalName User1@win.local
$user1 = Get-ADUser User1
New-ADUser -Name User2 -PasswordNeverExpires $true -AccountPassword ("Password123!" | ConvertTo-SecureString -AsPlainText -Force) -Enabled $true -UserPrincipalName User2@win.local
$user2 = Get-ADUser User2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment