Renaming an AD user (CN) VBS
I have tried 2 wa开发者_C百科ys (changing CN parameter and movehere) to rename a user in AD, without success. Everything else works (changing name, surname, alias...)
Help appreciated, Marius
From the MSDN on IADsContainer::MoveHere
:
The IADsContainer::MoveHere method can be used either to rename an object within the same container or to move an object among different containers. Moving an object retains the object RDN, whereas renaming an object alters the RDN.
For example, the following code example performs the rename action.
set cont = GetObject("LDAP://dc=dom,dc=com") set newobj = cont.MoveHere("LDAP://cn=Jeff Smith,dc=dom,dc=com", "cn=Denise Smith")
精彩评论