I use the SU command and you can pipe the password in from a text file. Only thing is that the workstation need a service installed on their machine. I did it through scheduled tasks for 60 users. If you have more it may take some time.
-----Original Message----- From: Joe Pochedley [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 14, 2003 11:32 AM To: NT 2000 Discussions Subject: RE: RUNAS You cannot provide a password to the cmd line just by using the runas command by itself. A cheeky vbscript programmer has written a script that will call runas and then provide the password to the password window when necessary, basically providing the same functionality you desire. The script takes it's options from the command line, but it's easy enough to modify the script to imbed the entire runas paramaters inside. Of course, the downside to all this is having the password for an account (usually one with more permissions that most users have) available as plain text (for those who know where/how to find it). This will probably wrap horribly, so if you want me to send you an attachment with the script, let me know. 'Start of Script 'VBRUNAS.VBS 'v1.2 March 2001 'Jeffery Hicks '[EMAIL PROTECTED] http://www.quilogy.com 'USAGE: cscript|wscript VBRUNAS.VBS Username Password Command 'DESC: A RUNAS replacement to take password at a command prompt. 'NOTES: This is meant to be used for local access. If you want to run a command 'across the network as another user, you must add the /NETONLY switch to the RUNAS 'command. ' ************************************************************************ ********* ' * THIS PROGRAM IS OFFERED AS IS AND MAY BE FREELY MODIFIED OR ALTERED AS * ' * NECESSARY TO MEET YOUR NEEDS. THE AUTHOR MAKES NO GUARANTEES OR WARRANTIES, * ' * EXPRESS, IMPLIED OR OF ANY OTHER KIND TO THIS CODE OR ANY USER MODIFICATIONS. * ' * DO NOT USE IN A PRODUCTION ENVIRONMENT UNTIL YOU HAVE TESTED IN A SECURED LAB * ' * ENVIRONMENT. USE AT YOUR OWN RISK. * ' ************************************************************************ ********* On Error Resume Next dim WshShell,oArgs,FSO set oArgs=wscript.Arguments if InStr(oArgs(0),"?")<>0 then wscript.echo VBCRLF & "? HELP ?" & VBCRLF Usage end if if oArgs.Count <3 then wscript.echo VBCRLF & "! Usage Error !" & VBCRLF Usage end if sUser=oArgs(0) sPass=oArgs(1)&VBCRLF sCmd=oArgs(2) set WshShell = CreateObject("WScript.Shell") set WshEnv = WshShell.Environment("Process") WinPath = WshEnv("SystemRoot")&"\System32\runas.exe" set FSO = CreateObject("Scripting.FileSystemObject") if FSO.FileExists(winpath) then 'wscript.echo winpath & " " & "verified" else wscript.echo "!! ERROR !!" & VBCRLF & "Can't find or verify " & winpath &"." & VBCRLF & "You must be running Windows 2000 for this script to work." set WshShell=Nothing set WshEnv=Nothing set oArgs=Nothing set FSO=Nothing wscript.quit end if rc=WshShell.Run("runas /user:" & sUser & " " & CHR(34) & sCmd & CHR(34), 2, FALSE) Wscript.Sleep 30 'need to give time for window to open. WshShell.AppActivate(WinPath) 'make sure we grab the right window to send password to WshShell.SendKeys sPass 'send the password to the waiting window. set WshShell=Nothing set oArgs=Nothing set WshEnv=Nothing set FSO=Nothing wscript.quit '************************ -----Original Message----- From: Attardo, Joe [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 14, 2003 10:55 AM To: NT 2000 Discussions Is there a way when using the runas command to incorporate the password so the user will not be prompted? ------ You are subscribed as [EMAIL PROTECTED] Web Interface: http://intm-dl.sparklist.com/cgi-bin/lyris.pl?enter=nt2000&text_mode=&la ng=english To unsubscribe send a blank email to %%email.unsub%% ------ You are subscribed as [EMAIL PROTECTED] Web Interface: http://intm-dl.sparklist.com/cgi-bin/lyris.pl?enter=nt2000&text_mode=&la ng=english To unsubscribe send a blank email to %%email.unsub%% ------ You are subscribed as [EMAIL PROTECTED] Web Interface: http://intm-dl.sparklist.com/cgi-bin/lyris.pl?enter=nt2000&text_mode=&lang=english To unsubscribe send a blank email to [EMAIL PROTECTED]
