Jump to content

Help creating Local Group and Users


Recommended Posts

I'm sure I've totally screwed up the syntax, but can someone please help me!

I'm trying to write a scrtipt that creates a Local group on a Windows XP Pro system and then adds a user to that group. FYI...At the time this script runs, the PC is logged in as the administrator.

This is what I've got so far and it's not working:

Func AddLocalGroup()
$groupname = "Temp Group"
$user = "User1"
Run(@ComSpec & " /c " & 'Net Localgroup "' & $groupname & '"' & " /ADD", "", @SW_HIDE)
Run(@ComSpec & " /c " & 'Net localgroup "' & $groupname & '"' & " " & $user & " /ADD", "", @SW_HIDE)
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...