Avatar of tenchulyo
tenchulyo asked on

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
Windows Server 2003IT AdministrationNetwork Operations

Avatar of undefined
Last Comment
tenchulyo

8/22/2022 - Mon
alicain

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

ASKER
tenchulyo

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
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
alicain

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
tenchulyo

Awesome!! Thanks a lot sir!