Set or modify display name of users with PowerShell Script in bulk and easy way
Please watch below link more details
• Modify Display Name with PowerShell CMDLet
• Set or modify display name of users with P...
===================================================================
$i = 0
$DisplayNameList = @()
#Add the new display name in below file in vertical format one by one
$DisplayNameList = Get-Content -Path "C:\Temp\DisplayName.txt"
Get User DN from file
#Add the samaccountname of users in below file in vertical format one by one
$UsersList = Get-Content -Path "C:\Temp\Users.txt"
foreach ($Tuser in $UsersList) {
Get the corresponding DisplayName for the user
$TempM = $DisplayNameList[$i]
Set the New DisplayName for users
Set-ADUser -Identity $Tuser -DisplayName $TempM
Increment the index to move to the user
$i++
}
Clear variables
$tuser = ''
$TempOU = ''
$DisplayNameList.clear()