scenarios, Requirements:
With the current expansion of the company's scale, originally only the Chinese name for the Aduser in the DisplayName attribute value phenomenon, has been in and foreign personnel exchanges have an impact. Cause the foreign personnel cannot recognize Aduser's displayname information. We know that regardless of exchange or SFB, their display name gets the DisplayName value.
First Export-csv-path | Get-aduser Export and modify information to preserve the required columns.
$file = Import-csv C:\users\administrator\desktop\alluser1.csvforeach ($data in $file) {$samaccount = $ Data.samaccountname$displayname = $data. Displaynameset-aduser-identity $samaccount-displayname $displayname}
Ideas:
This is mainly the Set-aduser-identity-displayname command and the Foreach usage method.
PS: This is my first blog post, we encourage each other together.
This article is from the "deep Sea One Tail Fish blog" blog, please make sure to keep this source http://5496038.blog.51cto.com/5486038/1855510
PowerShell bulk modifies Aduser's displayname properties