Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Adding a group to a local group with PSEXEC

Posted on 2009-07-16
6
Medium Priority
?
1,807 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 71

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 71

Accepted Solution

by:
Qlemo earned 1000 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
TCP/IP Network Protocol Cheat Sheet

TCP/IP is a set of network protocols which is best known for connecting the machines that make up the Internet. The truth is that TCP/IP is one of the oldest network protocols and its survival is mainly based on its simplicity and universality.

 
LVL 47

Assisted Solution

by:Donald Stewart
Donald Stewart earned 1000 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

Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

Question has a verified solution.

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

When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

721 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