Problem about ADSI username change

From: Drew (tianzhu123456_at_hotmail.com)
Date: 03/02/05


Date: Tue, 1 Mar 2005 17:39:08 -0800

I use the following code to change the username

Set oIADSUser = GetObject("LDAP://CN=AAA,CN=users,...")
oIADSUser.FullName = "BBB"
or
oIADSUser.Put "sAMAccountName", "BBB"
oIADSUser.SetInfo

However, I found the CN name cannot be changed ever after I change the SAM
account name from AAA to BBB. This user object's CN name is still AAA. In
other word, if again I want to change the name to CCC and LDAP://CN=BBB, an
error would be appear and the object cannot be found. To find this user
object I still need to use LDAP://CN=AAA.
Moreover from MMC of Active Directory Users and Computers, AAA still appears
in the Name column although the display name property of AAA was alreay
changed to BBB.

Why ? Is it a bug or ...

Any help would be greatly appreciated



Relevant Pages

  • Problem about ADSI user name change
    ... I use the following code to change the username ... oIADSUser.Put "sAMAccountName", "BBB" ... this user object I still need to use LDAP://CN=AAA. ... Is it a bug or ... ...
    (microsoft.public.windows.server.active_directory)
  • Question about ADSI username change
    ... I use the following code to change the username ... oIADSUser.Put "sAMAccountName", "BBB" ... this user object I still need to use LDAP://CN=AAA. ... Is it a bug or ... ...
    (microsoft.public.windows.server.active_directory)
  • Problem about ADSI username change
    ... I use the following code to change the username ... oIADSUser.Put "sAMAccountName", "BBB" ... this user object I still need to use LDAP://CN=AAA. ... Is it a bug or ... ...
    (microsoft.public.windows.server.active_directory)
  • Re: Case difference between NT and XP when using GetUserName API
    ... the samName property of the user object. ... preserved on NT but on XP the username is returned exactly as it was entered ... UserX(as it appears in the samAccountName). ...
    (microsoft.public.windowsxp.security_admin)
  • Re: solution to Word 2007 BUG options.printbackground failure
    ... If the username and initials fields are not filled in, ... Custom solutions that require this code for printing will fail silently (or ... have the user put their username and initials in word. ... I have reported this bug to Microsoft. ...
    (microsoft.public.word.vba.general)