Archived from groups: microsoft.public.win2000.active_directory (
More info?)
"Richard Mueller [MVP]" wrote:
> Wayne wrote:
>
> > I'm looking for an easy way to change all of my users from
> >
> > first initial lastname to firstname lastname or possibly firstname.lasnate
> >
> >
> > Ex.
> >
> > From
> > JDoe
> >
> >
> > To
> > JohnDoe
> >
> > OR
> > John.Doe
>
> Hi,
>
> The method depends on whether you are talking about the sAMAccountName (NT
> Name, or "pre-Windows 2000 logon name") or the Common Name ("cn" attribute)
> of the user. sAMAccountName can be modified like any other attribute, as
> long as the value you assign is unique in the domain. To modify cn you must
> rename the object. In VBScript you would use the MoveHere method. The cn
> attribute must be unique in the container/OU.
>
> If you have populated the sn and giveName attributes in AD (the last name
> and first name fields in ADUC), then you can construct either sAMAccountName
> or cn from these values.
>
> Because of the danger of duplicates and strange names, it would be wise to
> do this in two steps. First, use a script to write all user names to a text
> file or spreadsheet. Then modify the text file or spreadsheet as desired.
> You could add a new column in a spreadsheet and have it construct your new
> name with formulas based on first and last names in other columns. Then use
> a second script to read the names from the text file or spreadsheet and
> modify your user objects.
>
> Before suggesting code I would need to know:
>
> 1. Are you modifying cn or sAMAccountName.
> 2. Are the sn and givenName attributes populated with the values you want.
>
>
>
The first name and last name on the general tab is correct and shows John
and Doe. The "Display Name" shows John Doe
We want to change the username (sAMAccountName/pre-Windows 2000) to JohnDoe
or John.Doe
FYI, our users are in an OU 2 levels deep. For instance
domain.com
Company OU
Users OU
John Doe
Jane Doe