我試着使用如何填充在Active Directory中的管理領域,使用PowerShell
Import-Csv C:\Testimport.csv | ForEach-Object {Set-ADUser -Identity $_.samAccountName -Replace @{Manager=$_.manager}}
以填充AD經理字段,但我得到以下錯誤:
Set-ADUser : Cannot bind parameter 'Replace' to the target. Exception setting " Replace": "Object reference not set to an instance of an object." At line:1 char:95 + Import-Csv C:\Testimport.csv | ForEach-Object {Set-ADUser -Identity $.samAcc ountName -Replace <<<< @{manager=$.manager}} + CategoryInfo : WriteError: (:) [Set-ADUser], ParameterBindingEx ception + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.ActiveDirectory
.Management.Commands.SetADUser
您是否嘗試過解決此問題的任何內容? – 2014-10-18 13:34:15