請參考....
<pre class="c" name="code">
$ACCOUNTS='01','02','03','04','05','06','07','08','09','10'
$ACCOUNTS|foreach {
$NAME='SEAN'+"$_"
$PNAME="$_"+@contoso.com
New-Aduser $NAME -UserprincipalName $PNAME -Path "OU=IT,DC=contoso,DC=com" -AccountPassword (ConvertTo-SecureString -AsPlainText "Pssw0rd" -Force) -Enabled $true
}