Solved

Adding a group to a local group with PSEXEC

Posted on 2009-07-16
6
1,691 Views
Last Modified: 2013-11-09
Adding a group to a local group with PSEXEC

I am trying to run the follwoing script, but I get the message:
Net.exe exited on computername with error code 1

Psexec \\RemoteComputer Net localgroup "Remote Desktop Users" Domain\FinGroup /Add

Any idea ?

Thanks
0
Comment
Question by:jskfan
  • 2
  • 2
  • 2
6 Comments
 
LVL 69

Expert Comment

by:Qlemo
ID: 24870855
Which account are you using? It might help if you provide credentials to psexec, to make sure an admin account is used with appropriate access rights.
0
 

Author Comment

by:jskfan
ID: 24871147
I am running the psexec from a domain controller to another member server, I believe I don't need to put credentials there, since I am domain admins and I also am able to browse to the remote computer using \\Remotecomputername
0
 
LVL 69

Accepted Solution

by:
Qlemo earned 250 total points
ID: 24871679
You should not have to supply credentials, that's true.

psexec should print the output of the netsh command before it is reporting about errorlevel. Maybe you have done that net use already (in which case I get errorlevel 2, not 1, but who knows ...). PSExec itself does not have any errorcodes, it is just reporting the result of the called command.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 47

Assisted Solution

by:Donald Stewart
Donald Stewart earned 250 total points
ID: 24882148
Try placing your command in a .bat  Net localgroup "Remote Desktop Users" Domain\FinGroup /Add
 
Then use Psexec \\RemoteComputer -c -f -s \\server\share\rdpusers.bat
0
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 24882224
Also when testing the original command, you might have a group that dont exist or spelling issue. It is working for me(error code 0)
0
 

Author Comment

by:jskfan
ID: 24910609
for some reason it's working now.

Thanks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

777 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