Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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...

share|improve this question

1 Answer 1

Use the -c parameter. As in:

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

share|improve this answer
    
thank you so much!!! –  newbie Jul 27 '11 at 15:06
    
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 '11 at 15:09
    
quite frankly the ds* command are quite good at doing the above listed requirements. –  tony roth Jul 27 '11 at 22:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.