学习自:

徐鹏老师的 AD Powershell 系列视频课程


创建一个启用的用户:

必要属性:


  • Name

  • SamAccountName

  • UserPrincipalName

  • DisplayName

  • Path

  • AccountPassword

New-ADUser -SamAccountName test01 -Name test01 -UserPrincipalName [email protected] -DisplayName "test 01" -Path "ou=Lab,dc=satid,dc=com" -AccountPassword (ConverTo-SecureString "[email protected]" -AsPlainTest -Force) -Enabled $true

AD-新建用户命令 New-ADUser


批量创建10个用户

for{$i;$i -le 10;i++}
{
$user="user"+$i
$upn=$user+"@satid.com"
New-ADUser -SamAccountName $user -Name $user -UserPrincipalName $upn -DisplayName $user -Path "ou=Lab,dc=satid,dc=com" -AccountPassword (ConverTo-SecureString "[email protected]" -AsPlainTest -Force) -Enabled $true
}

AD-新建用户命令 New-ADUser

转载于:https://blog.51cto.com/zhaodongwei/1963630

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2021-10-08
  • 2022-02-08
  • 2022-01-19
  • 2022-12-23
  • 2021-06-13
猜你喜欢
  • 2021-05-09
  • 2021-12-09
  • 2021-07-30
  • 2022-12-23
相关资源
相似解决方案