Problem about ADSI user name change

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


Date: Tue, 1 Mar 2005 17:39:06 -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 even after I changed 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 use LDAP://CN=BBB,
an error would be appear and said the object could not be found. To locate
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

  • 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)
  • 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)
  • 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" ... in the Name column although the display name property of AAA was alreay ... Is it a bug or ... ...
    (microsoft.public.windows.server.active_directory)
  • Re: Moving Multiple users from many differnt OUs at once
    ... On Error GoTo 0 ... ' Failed to bind to user object. ... your users always matche exactly the sAMAccountName. ... will be cn, sAMAccountName, or distinguishedName. ...
    (microsoft.public.windows.server.scripting)