Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Replace AD Usern Import CSV

$
0
0

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.



Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>