[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 386
  • Last Modified:

I need a dos command to add members (other groups) to a group

please advise
0
itbabe
Asked:
itbabe
4 Solutions
 
Krzysztof PytkoActive Directory EngineerCommented:
domain environment or workgroup ?
0
 
shalabhsharmaCommented:
net localgroup administrators "domain\security groups" /add
0
 
karephreCommented:
net localgroup administrators username /add

fi you are on vista or windows 7 Make sure you right click and start CMD in Administrator  
0
 
boing40001Commented:
i think you can't add a group to another group using the net command.
You can do this with a simple vbs ( change the group names as you like):

On Error Resume Next

'get main objects/variables

Set ws = WScript.CreateObject ( "WScript.Shell" )
compname = ws.ExpandEnvironmentStrings ( "%COMPUTERNAME%" )
Set AdminGroup = GetObject ( "WinNT://" & compname & "/Administrators,group" )

'add domain groups to local admin group
AdminGroup.Add ( "WinNT://domain/Desktop_Admin,group" )
'End of the Script
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now