Solved

Adding a group to a local group with PSEXEC

Posted on 2009-07-16
6
1,705 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
Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

 
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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

830 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