Add user to Group remotely via batch

I am not on a domain controller (on a TS)  and I want to create a batch file that adds users to a certain group.

basically: [net local "MYGroup" User1 /add]  from a TS server.

I have some ideas but I was looking to see what others have in mind.

Thanks
tenchulyoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

alicainCommented:
Lots of ways to do this one, but perhaps the most basic is with the net command which you are familiar with.  The full syntax being here : http://technet.microsoft.com/en-us/library/bb490703.aspx
net group [groupname username[ ...] {/add | /delete} [/domain]]

net ThisIsMyGroupName ThisIsAUserName /add /domain

Assuming the terminal server is in the same domain...

Regards,
Alastair.
0
Pankaj_401Commented:
0
tenchulyoAuthor Commented:
Hi Alastair,

The issue with using this command is that there are spaces in my group names so it doesn't find the group, I tried a wildcard (*), but that doesn't work...but this is what I was originally looking at... (ex VPN Users rather than VPNUsers)...Unless you know a way around this... and changing all my group names is not an option...

Thanks,

Lyo
0
alicainCommented:
Hi Lyo,

Putting " " around it should do the trick...e.g. :

net group "domain users" /domain

Regards,
Alastair.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tenchulyoAuthor Commented:
Awesome!! Thanks a lot sir!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.