Re: Change AD display name

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 09/14/04


Date: Mon, 13 Sep 2004 19:52:41 -0600

I'm working from memory here, but...

In our environment, what we see in the Exchange global address list from our
outlook clients as the display name is coincidentally the same as what is
displayed in ADU&C as the "name" (i.e. we apply the same formatting
standards). To change both (as in the case where a person's last name has
changed), we click on the name field, select rename, enter the new value,
and are then prompted with a window from which some of the other
name-related attributes can be adjusted.

>From script, I think the way to change the RDN or CN is to bind to the
container object, and use the movehere method as indicated in the adsi help
file:
The IADsContainer::MoveHere method moves the specified object to the
container implementing this interface. Objects can be moved only within the
same directory system in which the container resides. The method can also be
used for renaming an object.

HRESULT IADsContainer::MoveHere(
  BSTR bstrSourceObject,
  BSTR bstrNewName,
  IDispatch ** ppbstrNewObject
);
Parameters
bstrSourceObject
[in] The string specifying the ADsPath of the object to be moved.
bstrNewName
[in] A relative name the new object within the container. This can be NULL,
in which case the object is just moved. If it is not NULL, the object is
renamed accordingly in the process.
ppbstrNewObject
[out] Indirect pointer to the IDispatch interface on the moved object.
Return Values
This method supports the standard return values, including S_OK for a
successful operation. For error code information, see ADSI Error Codes.

Remarks
The destination container must be in the same directory service as the
source container. Moving objects across directory service implementations is
not permitted.

The IADsContainer::MoveHere method can be used either to rename an object
within the same container or to move an object among different containers.
Moving an object retains the object's RDN, whereas renaming an object alters
the RDN.

For example, the following code snippet does the renaming:

set cont = GetObject("LDAP://dc=dom,dc=com")

set newobj = cont.MoveHere("LDAP://cn=John Doe,dc=dom,dc=com", "cn=John
Smith")

But the following code snippet does the moving:

set cont = GetObject("LDAP://dc=dom,dc=com")

set newobj = cont.MoveHere("LDAP://cn=jsmith,ou=sale,dc=dom,dc=com",
"cn=jsmith")

/Al

"Yevgen Lazaryev" <how_inventive_spammers_are@nospam.usa> wrote in message
news:O$NxuUTmEHA.2500@TK2MSFTNGP09.phx.gbl...
> ....The attribute is Relative Distinguished Name and referenced in AD
schema
> as "name" ..... But as far as I know (maybe someone correct me) you cannot
> change this attribute from the script ...One of the ways to get a new name
> for a user (the name displayed in AD window) is to create a new user with
> the same sAMAccount nad userPrincipal names and to delete the original one
> ...This, btw, will solve problem with new password also ..... But this
will
> be a new user with a new SID so if you have NTFS permissions set before -
> it's not a solution .... But you may consider that option ....
>
>
> "TK" <sprdthword@hotmail.com> a écrit dans le message de
> news:%236lOCfzlEHA.3824@TK2MSFTNGP12.phx.gbl...
> | Which attribute is it that changes the user display name in the AD
window?
> | I have changed the user's display name, but it does not change in the AD
> | window. I want to change many of these using a script but have no idea
> which
> | attribute to change and how to access it. I even tried changing the
> | sAMAccountName but still no change in the AD window.
> | I need to get this done this weekend so Please Help.
> | Thanks in advance.
> | TK
> |
> |
>
>



Relevant Pages

  • Re: PDA as "X terminal" [lengthy]
    ... moves that out to the physical display (via VNC or ... finished filling in the window *before* updating the ... Each cell is a (character, ... immediately above the "write pixel" level (note that it doesn't ...
    (comp.arch.embedded)
  • Re: SVGA, LCD, Win CE 6.0 and PB
    ... site addressing display drver issues, not to mention the source code. ... travel down thru Win CE from boot.ini to the place genrating final LCD ... I can have a desktop larger than physical screen window. ...
    (microsoft.public.windowsce.platbuilder)
  • Question about Full screen exclusive mode
    ... I use ScreenManager class that has been presented in David Brackeen's book. ... The graphics card enters the selected mode but the window content is painted only to the level of windows display mode.For example. ... After returning to the Windows, the settings dialog window is repainted with the content of the frame that is under settings dialog. ...
    (comp.lang.java.programmer)
  • Re: display array in a frame wnd
    ... I have to display results. ... The window can be used in all the program thanks to the name "source image". ... CFrameWnd* pw; ... Why is this not in an OnPaint handler? ...
    (microsoft.public.vc.mfc)
  • Re: Running an Access project crashes Access 2007 SP1
    ... That is not a very good example, because a form is a container ... so all of the 'child object' stuff already existed. ... window as a child, and cannot have siblings, but Access forms ... (The property window is still a subform window, ...
    (microsoft.public.access.adp.sqlserver)