Solved

Adding a group to a local group with PSEXEC

Posted on 2009-07-16
6
1,757 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
[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
  • 2
  • 2
  • 2
6 Comments
 
LVL 70

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 70

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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

This article summaries thoughts and ideas from two years of sustained use. It provides good reasoning to make the jump to Windows 10.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

636 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