Tesdall
(Getting the hang of it)
2010-09-14 09:09 PM
Net Local Group

Im converting a batch file over to kix and the command i have is to setup a new groups in the users/groups area. In the batch file i use:
 Code:
net localgroup administrators "domain\group" /add


but i don't seem to be able to find a code that "matches" it.

Point in the right direction?

i've searched around the message boads but cannot seem to find anything.

i've tried a few things:
 Code:
shell net localgroup administrators ""domain\group"" /add
run "%comspec% net localgroup administrators "domain\group"" /add

and multi variants of "'s and 's in different places. I have had it list everyone in the ADMIN group but no luck on actually adding the group.


Tesdall
(Getting the hang of it)
2010-09-14 09:12 PM
Re: Net Local Group

 Code:
shell "net localgroup Administrators domain\group /Add"


works when logged on as a local or domain admin.


Tesdall
(Getting the hang of it)
2010-09-14 09:23 PM
Re: Net Local Group

Im running into an issue no that i could use some help with.

 Code:
shell "net localgroup Administrators domain\domain admins /Add"


it would apepar that it will not let me do user groups with multiple names.

it would let me do the group IT but not the group DOMAIN ADMINS. If i wrap Domain admins in "",'', or "' it still will not let me do it.

Any ideas?


Tesdall
(Getting the hang of it)
2010-09-14 09:26 PM
Re: Net Local Group

 Code:
shell 'net localgroup Administrators "domain\domain admins" /Add'


works


Glenn BarnasAdministrator
(KiX Supporter)
2010-09-14 09:43 PM
Re: Net Local Group

Glad we could telepathically help!

Best practice for SHELL/RUN is to use single quotes for Kix strings and double-quotes for the command strings. Kix doesn't really care, but most command-line tools do, and insist on the doubles.

Glenn