?
Solved

Command line tool to supply user name and password.

Posted on 2006-04-05
2
Medium Priority
?
433 Views
Last Modified: 2010-04-18
Hi,

Is there any command line tool available to supply user name and password on destination computer before executing  any command.

For Example:

I will be running : REG.EXE QUERY \\computer_name\HKLM\System\CurrentControlSet\Services /s > result.txt

I'm processing the above commnd in a script. Some servers are skipped because they need different user name and password. If any command line tool is available that can be used to establish the connection (not necessarily secure) with remote computer and then next (REG.EXE) command or available commands.

Thanks!
SystmProg
0
Comment
Question by:Nirmal Sharma
2 Comments
 
LVL 4

Accepted Solution

by:
Nat_c earned 1000 total points
ID: 16382559
I think you can use the runas command

runas /user:domain\username "REG.EXE QUERY \\computer_name\HKLM\System\CurrentControlSet\Services /s > result.txt"

let me know if that works

Nat
0
 
LVL 4

Assisted Solution

by:averyb
averyb earned 1000 total points
ID: 16384427
Check out psexec at sysinternals.com.  

http://www.sysinternals.com/Utilities/PsExec.html
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

by Batuhan Cetin In this article I will be guiding through the process of removing a failed DC metadata from Active Directory (hereafter, AD) using the ntdsutil tool in a Windows Server 2003 environment. These steps are not necessary in a Win…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

755 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