PowerShell脚本记录
1.创建域账号
`$firstName = "005"
$lastName = "test"
$displayName = "$lastName, $firstName"
New-ADUser -Name "$firstName $lastName" `
-GivenName $firstName `
-Surname $lastName `
-DisplayName $displayName `
-SamAccountName "test005" `
-UserPrincipalName "test005@olympuspbi.agileex.com" ` #对应的是用户属性-User Logon Name
-Path "OU=agileex,DC=olympuspbi,DC=agileex,DC=com" `
-AccountPassword (ConvertTo-SecureString "P@ss1234" -AsPlainText -Force) `
-Enabled $true `
-PasswordNeverExpires $true `
-ChangePasswordAtLogon $false
Set-ADUser -Identity "test005" -DisplayName "test005"
浙公网安备 33010602011771号