1068 Error trying to duplicate user groups
Keywords: 1068 Error trying to duplicate user groups
Question:
I am trying write some code to clone users. To start off, I am trying to see if I can take group membership and copy it to an existing user. I tried to copy the information in my memberof attribute from my account to my test account. I get the '1068: Server is unwilling to perform operation' error. I sat down and had a man to man talk with the server, but it still will not cooperate.Anway, this is my code. Once I pull the info from the memberOf field, i can display it if I choose too. I'm thinking I can't just simply put it into another account.
AddExtender("WWADS34I.DLL") AdsiPath = "LDAP://MYDOMAIN.COM/DC=MYDOMAIN,DC=com" UserPath = dsFindPath(AdsiPath, "cn=cc3002") AdsiPath2 = "LDAP://MYDOMAIN.COM/DC=MYDOMAIN,DC=com" UserPath2 = dsFindPath(AdsiPath, "cn=cc3002t") grouplist = dsGetProperty(UserPath,"memberof") ; message("",grouplist) dsSetProperty(UserPath,"memberof",grouplist)Answer:
To add a user to a group you need to use the "dsAddtogrp" function on the group object. AD automagicly maintains the "memberOf" attribute.
Article ID: W15028