Solved

Batch file

Posted on 2013-06-04
3
346 Views
Last Modified: 2013-06-05
i have this script: net localgroup Administrators "techlabtest\Finance" /Add
techlabtest is my domain
Finance is my security group
Inside Finance there are 3 domain user which do not have admin access.
I want to give them admin access at the same time.

Just for testing my script, When i run it manually on a user pc, i got access denied.

When i run it on an administrators account, it works well.

Please help me.

Thanks
0
Comment
Question by:techlabtest
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 85

Accepted Solution

by:
oBdA earned 500 total points
ID: 39218693
The security model of Windows would be pretty weak if just about everybody could add a group to the local Administrators group of a server.
In other words: you have to be a local administrator to add other members to the local Administrators group. No way around it.
You can use a Restricted Groups GPO if you want to automate this.
Restricted Groups
http://technet.microsoft.com/en-us/library/cc785631(v=ws.10).aspx
0
 
LVL 7

Expert Comment

by:BT15
ID: 39219735
the above holds true if you are launching the script manually.

However, if you assign the script as a startup script in a GPO, then it will probably work the next time the machine reboots.

We do something similar here with VBS
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

688 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