Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
You can’t perform that action at this time.