Re: Change AD display name
From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 09/14/04
- Next message: Yevgen Lazaryev: "Re: Change AD display name"
- Previous message: Al Dunbar [MS-MVP]: "Re: Script to get NT domain group info"
- In reply to: Yevgen Lazaryev: "Re: Change AD display name"
- Next in thread: Yevgen Lazaryev: "Re: Change AD display name"
- Reply: Yevgen Lazaryev: "Re: Change AD display name"
- Messages sorted by: [ date ] [ thread ]
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
> |
> |
>
>
- Next message: Yevgen Lazaryev: "Re: Change AD display name"
- Previous message: Al Dunbar [MS-MVP]: "Re: Script to get NT domain group info"
- In reply to: Yevgen Lazaryev: "Re: Change AD display name"
- Next in thread: Yevgen Lazaryev: "Re: Change AD display name"
- Reply: Yevgen Lazaryev: "Re: Change AD display name"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|