Skip to content

Instantly share code, notes, and snippets.

@gowatana
Created July 2, 2022 11:18
Show Gist options
  • Save gowatana/01b2c61527ee18a6497507ee62094eeb to your computer and use it in GitHub Desktop.
Save gowatana/01b2c61527ee18a6497507ee62094eeb to your computer and use it in GitHub Desktop.
$ad_user_name_prefix = "demo-user-"
$ad_user_pass = "VMware1!"
$ou_path = "OU=demo-ou-01,DC=euc,DC=go-lab,DC=jp"
$ad_group_name = "demo-group-01"
1..10 | %{
$ad_user_name = $ad_user_name_prefix + $_.ToString("000")
echo "User Name: $ad_user_name"
New-ADUser -Name $ad_user_name `
-AccountPassword ($ad_user_pass | ConvertTo-SecureString -AsPlainText -Force) `
-Path $ou_path -Enabled:$true
Add-ADGroupMember -Identity $ad_group_name -Members $ad_user_name
}
@gowatana
Copy link
Author

gowatana commented Jul 2, 2022

下記の投稿向け
Horizon 検証むけの AD ユーザ作成の効率化。(PowerShell)
https://vm.gowatana.jp/entry/2022/07/02/225810

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment