Hey experts,
I get a replacefor some users but in some, this works.
Error:
Set-ADUser : replace In C:\Users\Administrator\Desktop\Powershell\Import_bearbeiten.ps1:3 Zeichen:1+ Set-ADUser -Identity $_.SamaccountName -GivenName $_.Vorname -Surname $_.Nachnam ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : InvalidOperation: (bohm:ADUser) [Set-ADUser], ADInvalidOperationException+ FullyQualifiedErrorId : ActiveDirectoryServer:0,Microsoft.ActiveDirectory.Management.Commands.SetADUser
Script:
Import-Csv -Delimiter ";" -Path C:\Users\Administrator\Desktop\Powershell\Export_cherwell_bearbeitet.csv | %{ Set-ADUser -Identity $_.SamaccountName -GivenName $_.Vorname -Surname $_.Nachname -OfficePhone $_.Telefon -Company $_.Firma -Department $_.Organisationseinheit -EmailAddress $_.EMail }
Thanks for your help.