Im trying to populate the manager fields on AD using
Import-Csv C:\Testimport.csv | ForEach-Object {Set-ADUser -Identity $_.samAccountName -Replace @{Manager=$_.manager}}
But I get the following error:
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