DSADD user -memberof usage
I want to add a particular user on my Domain to Multiple groups using DSADD user command. I tried doing the same doing this:
DSadd user "CN=Last\, First,OU=AB,DC=Xyxyxyx,DC=Com" -pwd Password -samid
First.last -fn First -ln Last -empid 12345 -display "Last, First" -loscr
Script.vbs -upn First.Last@Xyxyxyx.com -memberof "CN=.Abc
Def,OU=AB,DC=Xyxyxyx,DC=com"
But it only allows me to add a new user to one group at creation time. Can anyone please tell me what the correct syntax for using DSADD user command is? Thanks in advance,
Re: DSADD user -memberof usage
You are correct to far extent but there is a small mistake. You will need to separate group distinguished names with spaces. For example (watch line
wrapping, it usually wraps at spaces):
dsadd user "CN=Last\, First,OU=AB,DC=Xyxyxyx,DC=Com" -memberOf
"cn=group1,OU=AB,DC=Xyxyxyx,DC=Com" "cn=group2,OU=AB,DC=Xyxyxyx,DC=Com"
All values up to the next dash "-" are taken as group distinguished names.
Re: DSADD user -memberof usage
I think you are right. Microsoft should better update their help, because there written that DN's must be separated with ";".
Re: DSADD user -memberof usage
Thank you very much for the help LeonL. That did the trick, it seems obvious now and I did try a few variations but not that one.