Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: rename user AD domain
Either you might want...
wntUserSetDat("\\pdcname","test","full_name","test2",0)which is what I think you want...
or is running in a "pure" ADSI installation (not mixed mode_ then you would have to use the ADSI extender and a whole different way of doing this. However since you can change somethings, then I think the proper wntUserSetDat command, as above, should work...
If you want to actually rename an object in Active Directory then you need to use the ADSI extender.
AddExtender("WWADS34I.DLL") AddExtender("WWWNT34i.DLL") ;Change display name errormode(@off) sAdsiPath ="LDAP://server/cn=users,dc=domain,dc=com" dsSetCredent("domain\administrator", "password") sEmpireGroup = dsFindPath(sAdsiPath , "CN=olduser") dsSetProperty(sEmpireGroup, "givenname", "newuser") dsSetProperty(sEmpireGroup, "userprincipalname", "newuser@domain.com") dsSetProperty(sEmpireGroup, "displayname", "newuser") sNewPath = dsMoveObj(sEmpireGroup, sAdsiPath, "cn=newuser") ;Check if change ok? sEmpireGroup = dsFindPath(sAdsiPath , "cn=newuser") slist = dsGetProperty(sEmpireGroup, "name") if slist <> "newuser" then message("","error") else message("","User renamed!") end if errormode(@cancel) ;Change full name wntUserSetDat("\\%server1%","olduser","full_Name","newuser",0) ;Change login name wntUserRename("\\%server1%", "olduser", "newuser" ,0)
Article ID: W15557
File Created: 2003:05:13:11:28:52
Last Updated: 2003:05:13:11:28:52