Updating Phonenumbers in AD via csv with Powershell -
please guys, help me out here.
i have created file next command:
get-aduser -filter * -properties samaccountname,distinguishedname,telephonenumber | select-object samaccountname,distinguishedname,telephonenumber,address,city | export-csv c:\shares\testshare\new3.csv -notypeinformation -delimiter ";" -encoding utf8;
this works charm, love of god, cannot manage import again, wanna alter phonenumbers in excel sheet, , insert altered file ad.
basically has robbed me 3 days worth of time already, , client becoming edgy..
edit:
i tried run script posted ansgar wiechers unfortunately got few error messages.
use complementary cmdlets in reverse order:
$csv = 'c:\shares\testshare\modified3.csv' import-csv $csv -delimiter ';' -encoding utf8 | % { get-aduser -identity $_.samaccountname | set-aduser -officephone $_.telephonenumber }
edit: error messages suggest seek assign empty telephone numbers. verify adding next line before get-aduser
:
write-output "{0} [{1}]" -f $_.samaccountname, $_.telephonenumber
powershell csv cmdlet
No comments:
Post a Comment