Skip to Content
Active Directory Cookbook
book

Active Directory Cookbook

by Robbie Allen
September 2003
Intermediate to advanced
624 pages
15h 49m
English
O'Reilly Media, Inc.
Content preview from Active Directory Cookbook

6.31. Modifying the Default Display Name Used When Creating Users in ADUC

Problem

You want to modify how the default display name gets generated when you create a new user through the Active Directory Users and Computers snap-in.

Solution

Using a graphical user interface

  1. Open ADSI Edit.

  2. In the Configuration Naming Context browse to DisplaySpecifiers <Locale> where <Locale> is the locale for your language (e.g., the US English locale is 409).

  3. Double-click on cn=user-Display.

  4. Edit the createDialog attribute with the value you want the new default to be (e.g., %<sn>, %<givenName>).

  5. Click OK.

Using VBScript

' This code modifies the default ADUC display name.
' ------ SCRIPT CONFIGURATION ------
strNewDefault = "%<sn>, %<givenName>"
strForestName = "<ForestDNSName>"     ' e.g. rallencorp.com
' ------ END CONFIGURATION ---------

Set objRootDSE = GetObject("LDAP://" & strForestName & "/RootDSE")
Set objDispSpec = GetObject("LDAP://cn=User-Display,cn=409," & _
                              "cn=DisplaySpecifiers," & _
                              objRootDSE.Get("ConfigurationNamingContext"))
objDispSpec.Put "createDialog", strNewDefault
objDispSpec.SetInfo
WScript.Echo "New default for user's display name has been set to: " & _
              strNewDefault

Discussion

When you create a new user object in the Active Directory Users and Computers snap-in, it will automatically fill in the Full Name field as you type in the First Name, Initials, and Last Name fields. As a convenience, you may want to alter that behavior so that it automatically fills in a different value. To ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Active Directory Administration Cookbook

Active Directory Administration Cookbook

Sander Berkouwer
Active Directory Cookbook, 3rd Edition

Active Directory Cookbook, 3rd Edition

Laura E. Hunter, Robbie Allen
Active Directory Cookbook, 4th Edition

Active Directory Cookbook, 4th Edition

Brian Svidergol, Robbie Allen

Publisher Resources

ISBN: 0596004648Supplemental ContentCatalog PageErrata