How to Modify AD CN Field




Hi,

How to Modify AD CN or Name Field stored in Active Directory.
The server would be Server 2003 without SP2.
Could any one help me on this issue.
Many thanks in advance.
BTW: old sam account like this "000123" DisplayName "Jack" ...

============================================

option explicit
dim strOU,strUser,strName,colAccounts,objUser,objUser2,UsersCount
strOU = "OU=Test,"
UsersCount=0
Set colAccounts=GetObject("LDAP://"; & strOU & "DC=ABC,DC=COM")
colAccounts.Filter = Array("user")

For Each objUser In colAccounts
if instr(objUser .SamAccountName, "$") = 0 then
strUser = objUser.Name
if left(objUser.sAMAccountName,1) = "0" then
strName="6" & right(objUser.sAMAccountName,len(objUser.sAMAccountName)-1)
else
strName=objUser.sAMAccountName
end if

objUser.sAMAccountName = strName
objUser.userPrincipalName = strName & "@ABC.COM"
'''''''''''''''''''''''''
' err... how to change ? CN or Name field
'''''''''''''''''''''''''
objUser.CN = strName
objUser.SetInfo
UsersCount=UsersCount+1
end if
Next



.



Relevant Pages

  • Re: How to Modify AD CN Field
    ... How to Modify AD CN or Name Field stored in Active Directory. ... The server would be Server 2003 without SP2. ... objUser.sAMAccountName = strName ...
    (microsoft.public.windows.server.scripting)
  • SP2 and SQL and Active Directory
    ... Active directory on Windows 2000 server. ... This also failed after installation of SP2. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: 2003 Migration
    ... Best Practice Active Directory Design for Managing Windows Networks ... Windows Server 2003 Tools ... ensure that you have designed a DNS and Active ...
    (microsoft.public.windows.server.active_directory)
  • Re: Urgent Advise - [WildPacket]
    ... Best Practice Active Directory Design for Managing Windows Networks ... Windows Server 2003 Tools ... ensure that you have designed a DNS and Active ...
    (microsoft.public.windows.server.active_directory)
  • Re: i got 6 server in company which contains NT4 , windows 2000 , windowser 2003
    ... Best Practice Active Directory Design for Managing Windows Networks ... Windows Server 2003 Tools ... ensure that you have designed a DNS and Active ...
    (microsoft.public.windows.server.active_directory)