Solved

Adding a group to a local group with PSEXEC

Posted on 2009-07-16
6
1,661 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 68

Expert Comment

by:Qlemo
Comment Utility
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
Comment Utility
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 68

Accepted Solution

by:
Qlemo earned 250 total points
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 47

Assisted Solution

by:dstewartjr
dstewartjr earned 250 total points
Comment Utility
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:dstewartjr
Comment Utility
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
Comment Utility
for some reason it's working now.

Thanks
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
The viewer will learn how to count occurrences of each item in an array.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now