1

i am trying to assign user A with the same group memberships as user B. the problem is user A is already member of some of the groups user B is and when i try to run below command it errors out as soon as it finds the group user A is already member of. e.g. user A is member of abc, def and user B is member of abc, ghi, lmn and when i run this command, it stops processing and gives me an error saying user A is already member of group abc and doesnt go any further.

so could you please tell me how can make the assignment keep going and skip whatever group user A is assigned to?

dsquery user -samid B | dsget user -memberof -expand |dsmod group -addmbr "A"

please provide non-programming solution as not good at programming.

thank you...

1 Answer 1

2

Use the -c parameter. As in:

dsquery user -samid B | dsget user -memberof -expand |dsmod group -c -addmbr "A"

2
  • is it possible you can tell me a good website or book which i can use to learn VBScript to get the reports from AD or do user administation in AD or export AD results into excel, etc. any help would be nice!!!
    – newbie
    Jul 27, 2011 at 15:09
  • quite frankly the ds* command are quite good at doing the above listed requirements.
    – tony roth
    Jul 27, 2011 at 22:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .