[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Add Domain Security Group to Local Administrators Group of Workstations

Posted on 2010-03-27
6
Medium Priority
?
1,498 Views
Last Modified: 2012-05-09
I tried to use PSEXEC to leverage a command to add a newly created security group from Active Directory to the local workstations local administrators group. no matter how I wrote the command, it did not work. Any suggestions? Is this not possible?

I kept getting error code 1 and error code 2

1st attempt
psexec @c:\computers.txt net localgroup Administrators "US\New Security Group" /add

2nd attempt
psexec @c:\computers.txt net localgroup Administrators /add  "US\New Security Group"

3rd attempt
psexec @c:\computers.txt net localgroup Administrators US\New Security Group /add

4th attempt
psexec @c:\computers.txt net localgroup Administrators /add US\New Security Group

nothing worked. I think it has to do with syntax or the fact that I have a space in the name of hte security group.

any help...
0
Comment
Question by:thesurg3on
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:wrt1mea
ID: 28782725
Hello,

Looks like there is something similar here where they used group policy to push this to the workstations on the domain join. Perhaps this can point you in the right direction.

http://serverfault.com/questions/48663/add-a-workstation-administrators-to-local-administrators-group-on-domain-join
0
 

Author Comment

by:thesurg3on
ID: 28783042
group policy would be great, but this is more of a unique situation and we need to target a subset of computers, rather than reorganize them and write a group policy.

surely there is a scripted way to do this.
0
 
LVL 1

Expert Comment

by:wrt1mea
ID: 28783518
I had a feeling you were gonna say that....

How about this:

http://support.microsoft.com/kb/297307

Its a utility that is apart of the server software.
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
LVL 1

Accepted Solution

by:
jrespo earned 2000 total points
ID: 28786426
You can give this a try;

Dim DomainName
Dim GroupAccount

Set net = WScript.CreateObject("WScript.Network")
local = net.ComputerName
DomainName = "your domain"
GroupAccount = "your group"
set group = GetObject("WinNT://"& local &"/Administrators")

on error resume next

group.Add "WinNT://"& DomainName &"/"& GroupAccount &""
CheckError

sub CheckError
     if not err.number=0 then
          set ole = CreateObject("ole.err")
          MsgBox ole.oleError(err.Number), vbCritical
          err.clear
     end if
end sub
0
 

Author Comment

by:thesurg3on
ID: 28813846
not sure if cusrmgr is available for server 2003. I am going to try this script that jrespo wrote.
0
 

Author Closing Comment

by:thesurg3on
ID: 31707875
thanks.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…

613 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question