Net user command to add group to local admin

  • Thread starter Thread starter martie
  • Start date Start date
M

martie

Hi everybody,

Im trying to create a batch file which will add a
Group into my computers "Administrators" local group.

The group is called "Domain Techs" & each belong to 3
different Domains which can access each other with no
problem.

I have gone through technet
article "http://support.microsoft.com/?kbid=251394"
however im not having much luck.


In the past I've being able to write a batch file which
created a local account & added that account into
the "administrators" local account but Im not having much
luck with this excercie......any help would be highly
appreciated.

thankyou in advance.
 
Hi Davie,


Ok well I've made some progress, basically i figured
that the command will be as follows

net localgroup "administrators" domain\groupname.

So on a workstation called "xp1" which is part of the
domain called "LabdomainA" i was able to add a group i
created in that domain called "TEST" into
the "Administrators" local built in group of "xp1" via the
net localgroup as,

net localgroup "administrators" LabdomainA\Test /add

& it worked ..the group called "Test" which was created in
the "LabDomainA" is now added into the
Local "administrators" group of workstation
called "XP1" ..sorry if i sound like im repeating myself..

the probleme im having is when i try to add the "Domain
Techs" group from the same domain i get the following error

"There is no such global user or group: LabdomainA\domain
There is no such global user or group: Techs

More help is available by typing Net Helpmsg3783"

however it's not providing me with the adequate info to
get it working ?

any idea were i may be going wrong ?

thank for your reply.
 
Can you believe 1 minute after i finished replying to you
i found my answer "I hope" - basicall i used the following

net localgroup administrators "LabdomainA\Domain
Techs" /add

& it worked...so all along i just had to place
the "labdomainA\domain techs" in inverted comas & the
command worked...

sorry to have wasted any of your time....btw the url were
i found the solution was

http://cwashington.netreach.net/depo/view.asp?
Index=361&ScriptType=command

Im going to test it out @ work as i've tested it out in a
Vmware lab enviroment
I'll let you know how it goes

regards,

Martie.
 
Anytime a space exists in a name, it must be enclosed in quote marks.
You can also use quote marks all the time, so a batch with unknown group names
always works.




Can you believe 1 minute after i finished replying to you
i found my answer "I hope" - basicall i used the following

net localgroup administrators "LabdomainA\Domain
Techs" /add

& it worked...so all along i just had to place
the "labdomainA\domain techs" in inverted comas & the
command worked...

sorry to have wasted any of your time....btw the url were
i found the solution was

http://cwashington.netreach.net/depo/view.asp?
Index=361&ScriptType=command

Im going to test it out @ work as i've tested it out in a
Vmware lab enviroment
I'll let you know how it goes

regards,

Martie.


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Back
Top