Tuesday, November 12, 2013

Home /PowerShell /script / Update Display Name, Name, Initials etc–PowerShell Script

Update Display Name, Name, Initials etc–PowerShell Script

Here is a PowerShell V2.0 script which you can use to update Display Name, Name, Initials etc.  Of course you can change or select different attributes as needed.  You can get attribute derails from here - http://portal.sivarajan.com/2010/07/aduc-and-ldap-reference-sheet.html

In this script, I am updating display name in LastName, FirstName (Initial) format.  Initial is the first characters from First and Last name.  You can change this logic by modifying the following code:

$Ufname = $Uinfo.GivenName
$ULname = $Uinfo.Surname
$CurrentDispalyName = $Uinfo.Displayname
$NewInitial = $Ufname[0]+$ULname[0]
$NewInitial = $NewInitial.toupper()
$NewDisplayname = $ULname + ", " + $Ufname + " (" + $NewInitial + ")"

Also, I am using an input file with samaccountname.  You can select an OU instead of an input file.

image

Output file (DisplayName_Output.txt) will have the Current Display Name, New Display name and New Initials information.

Script  can be downloaded from the following location:

image

SS

Santhosh Sivarajan

Microsoft MVP · Identity & Cybersecurity Architect

Santhosh has 30+ years of hands-on enterprise experience in Identity and Access Management, Microsoft Entra ID, Active Directory, Microsoft 365 and Zero Trust architecture. He is the author of two books on Windows Server and security, and leads consulting, assessments and training at SAG Business Group.

1 comments:

Navigating the intricate landscape of tax preparation can often be a daunting task, but with the right tools and guidance, you can ensure that you're not leaving any potential tax savings on the table. "How To Claim Your Maximum Tax Refund with TurboTax" is a comprehensive guide designed to empower individuals with the knowledge and tools they need to maximize their tax refund using one of the most trusted tax preparation software platforms available.

Post a Comment

Popular Posts
Workstation Trust Relationship Issue Issue: You receive the following error message, when you try to login to the domain.  The security database on the server does not have ... ADMT Service Account - Permission and Configuration The ADMT service account needs to have proper permission in source and target domains.  You don’t need to use 2 separate accounts.  You can ... My First Peek into Microsoft Exchange 2010 By Santhosh Sivarajan Before I really dive into Exchange 2010, I thought I would install and play with it first. I took some screen shots and notes during the ins... ObjectSID and Active Directory What is an objectSID in Active Directory? When a new object is created in Active Directory, Domain Controller assigns a unique value used ... AD Group Report - List Group Members in Active Directory–PowerShell Script Updated Script - http://portal.sivarajan.com/2011/10/search-ad-collect-local-admin-group.html Script #1 This script... Add Users to a Group–PowerShell Script Purpose – Add users to a group from an input file – PowerShell V2 Script.  Input file – Input file (Users.csv) contains samAccountName in... User Account Migration and Merging – Part I (ADMT) Part I - User Account Migration and Merging Using ADMT Part II - User Account Migration and Merging Using QMM pre-creating user account ... User Account Migration and Merging – Part II (Quest Migration Manager) Part I - User Account Migration and Merging Using ADMT Part II - User Account Migration and Merging Using QMM Pre-creating user account in... Delete Stale or Inactive Computer Accounts from Active Directory Here is an easy way to identify and delete inactive or stale computers in an Active Directory environment.  Using the dsquery command you c... Converting PowerShell (PS1) to EXE / Standalone Application As we know, there many applications available to convert a PowerShell file to a standalone executable file.  Based on my experience, PowerSh...