For /L %A in <1,1,100> do net user mailuser%A abc@123 /add /domain
使用AD的powershell命令進(jìn)行創(chuàng)建,腳本如下。我們事先把用戶(hù)名信息放到CSV文件中,然后讀取CSV文件創(chuàng)建賬戶(hù)。
$UserCSV=Import-Csv -Path "D:\powershellscript\aduser.csv" -Encoding Default$password=ConvertTo-SecureString -String "!@c20160310" -AsPlainText -Force$UserCSV | foreach `{New-aduser -DisplayName $_.DisplayName `-SamAccountName $_.SamAccountName `-Name $_.DisplayName `-Company $_.Company `-Department $_.Department `-AccountPassword $password `-Enabled $true `-Path "OU=users,DC=demo,DC=com"}
1..10 | ForEach { Net User "User$_" MyPassword=01 /ADD /Domain; Enable-Mailbox "User$_" }
獲取更多IT資訊,您也可以關(guān)注下方的微信公眾號(hào):
曾垂鑫的網(wǎng)絡(luò)課堂,曾垂鑫 MySQL,微軟認(rèn)證 大講堂 - 51CTO學(xué)院
http://edu.51cto.com/lecturer/639838.html
聯(lián)系客服