我正在研究一个小脚本,以便更容易地将用户添加到AD中。这只是一个新的ADUser PowerShell脚本,要求输入。它看起来像这样:添加新的AD用户时出错
New-ADUser -Name (Read-Host "User Name") -AccountExpirationDate 0 -CannotChangePassword 1 -ChangePasswordAtLogon 0 -PasswordNeverExpires 1 -Company (Read-Host "Company") -Department (Read-Host "Department") -Title (Read-Host "Title") -Manager (Read-Host "Manager's User Name") -GivenName (Read-Host "Full Name") -MobilePhone (Read-Host "Cell Phone Number") -State (Read-Host "State") -AccountPassword (Read-Host -AsSecureString "Password") -ProfilePath (Read-Host "Roaming Profile Path") -Path (Read-Host "AD Path to User")
,它要求一切都像它应该,但输入返回后一切:“新ADUser便有:不是有效的Win32 FILETIME在行:1个字符:11”我在命令中检查了这个位置(这是“New-ADUser”之后的空格),我不知道它为什么会返回该位置。
这是做我想做的一种有效的方式吗?我如何解决我的命令不返回错误?这是我输入的点吗?
啊是的,[this](http://ss64.com/ps/new-aduser.html)源代码是一样的。 – elock37