question

AbdulBasith-2983 avatar image
0 Votes"
AbdulBasith-2983 asked shashishailaj commented

update the Existing all AD users firstname, last name and email address with a csv

Hi,

I need to update the Existing all AD users firstname, last name and email address with a csv.. and i need the csv format for above task..

windows-active-directory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AbdulBasith-2983 avatar image
1 Vote"
AbdulBasith-2983 answered shashishailaj commented

I figured out the script

$users = Import-Csv -Path c:\scripts\users.csv

foreach ($user in $users) {

Get-ADUser -Filter "SamAccountName -eq '$($user.samaccountname)'" -Properties * |

Set-ADUser -givenName $user.givenName -displayname $user.displayname -Surname $User.sn -Email $user.mail

}

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AbdulBasith-2983 ,

Thank you for sharing your solution with the community .

0 Votes 0 ·