最全的winserver批量增加用戶


一、批量創建用戶

for /l %i  in (1,1,10) do net user  test%i   !QAZ2wsx   /add 

二、批量設置用戶密碼永不過期

for /l %i in (1,1,10) do net user test%i  /expires:never     注意:此用戶必須存在

三、批量創建用戶到指定的用戶組內

for /l %i in (1,1,10) do net user test%i   !QAZ2wsx   /add  net localgroup  "TelnetClients" test%i   /add

四、批量刪除用戶

for /l %i in (1,1,10) do net user test%i  !QAZ2wsx  /delet  /expires:Never

五、批量增加域用戶

$Password = "!QAZ2wsx"
$SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force
1..10 |foreach-object {New-ADUser -Name "test$_" -SamAccountName "test$_" -UserPrincipalName test$_@songchen.com -path "OU=test,DC=songchen,DC=com" -AccountPassword $SecurePassword -Enabled $true -ChangePasswordAtLogon $false}

 

 

 

 

同步時間服務器:w32tm /config /manualpeerlist:"ntp.aliyun.com" /syncfromflags:manual /reliable:yes /update

 

 

注意:第一步,第二步,第三步,第四步,必須用cmd命令行(管理員運行模式去運行)

   第五步,用Powershell批量創建測試域用戶

 

 

如有不懂的請參考鏈接:https://www.cnblogs.com/wulongy/p/14696228.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM