|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to Modify AD CN FieldHow 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 Use MoveHere method of the parent object - refer to
http://www.microsoft.com/technet/scriptcenter/guide/sas_usr_aznz.mspx?mfr=true for more info... hth Marcin Show quoteHide quote "Jackliu" <ad***@private.overmcse.com> wrote in message news:%2369$RJdWJHA.3920@TK2MSFTNGP05.phx.gbl... > 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 > > >
What is error '80041003', please?
Simple Ping Script Is there any way to control the Transport Server (subcomponent of Windows Deployment Services) via P How can I do a WMI Bulk data retrieval ? DISKPART select command doesn't have a "noerr" command for scripti Net send over different domains Problem calling oADsSecurityUtility.SetSecurityDescriptor from VBScript Monitor Folder Recursively using WMI can I do this from answer file or do I need to script post install? Variable |
|||||||||||||||||||||||