#189607 - 2008-09-11 03:09 PM
RUNNAS.exe
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Hello looking for a little help, hopefully this will be a quick one. using the following code. IF INGROUP("Psinstall") $Powershell = ReadValue('HKLM\SOFTWARE\Microsoft\PowerShell\1\','Install') If $Powershell <> 1 $server="@lserver\netlogon\bats\WindowsXP-KB926139-v2-x86-ENU.exe" $runaspath="@lserver\netlogon\runnas.exe" SHELL '$runaspath /user:@wksta\Administrator $server /pass:XXXXXX' Endif Endif I can not get it to use the local administrator usercode and password to run the exe.. If I use a domain level account it will work.. Can you not use the local account??
_________________________
You'll never know, unless you ask.
|
Top
|
|
|
|
#189609 - 2008-09-11 03:23 PM
Re: RUNNAS.exe
[Re: Mart]
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
But isn't that what I have here?
SHELL '$runaspath /user:@wksta\Administrator $server /pass:XXXXXX'
Am I doing the syntax wrong, and not seeing it?
_________________________
You'll never know, unless you ask.
|
Top
|
|
|
|
#189611 - 2008-09-11 04:08 PM
Re: RUNNAS.exe
[Re: Mart]
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Sadly no go.. any other thoughts? Strange that the same syntax works for domain account but not local. and yes, the administrator usercode and password are correct.
_________________________
You'll never know, unless you ask.
|
Top
|
|
|
|
#189612 - 2008-09-11 06:00 PM
Re: RUNNAS.exe
[Re: Thom]
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Well here is another caveat.. It works when I have the exe on a network share. But I have to supply a domain usercode and password. Therefore the password is visable in the script.. Where this is going to be on a share that others can see, how can I make the password invisible to others or have it encrypted in the script, so they can not see it.. Is this possible?
_________________________
You'll never know, unless you ask.
|
Top
|
|
|
|
#189640 - 2008-09-12 06:18 PM
Re: RUNNAS.exe
[Re: Shawn]
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Shawn
I will see if I can figure that out. I am running the version with two n's.
_________________________
You'll never know, unless you ask.
|
Top
|
|
|
|
#189642 - 2008-09-12 06:52 PM
Re: RUNNAS.exe
[Re: Thom]
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Shawn
Do you see anything here that would cause the /quiet switch not to work? Other than being a crappy coder I need help..
Thanks.
IF INGROUP("Psinstall") $Powershell = ReadValue('HKLM\SOFTWARE\Microsoft\PowerShell\1\','Install') If $Powershell <> 1 $local="%systemroot%\temp" $server="@lserver\netlogon\bats\WindowsXP-KB926139-v2-x86-ENU.exe" copy $server $local $Winpath = "$local\WindowsXP-KB926139-v2-x86-ENU.exe /quiet" $runaspath="@lserver\netlogon\runnas.exe" SHELL $runaspath + ' /user:' + @wksta + '\Administrator ' + $winpath + ' /pass:xxxxxxxx' Endif Endif
_________________________
You'll never know, unless you ask.
|
Top
|
|
|
|
#189657 - 2008-09-14 02:33 AM
Re: RUNNAS.exe
[Re: Shawn]
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Yes, if you rub the install with the /quite switch in a dos box, you don't see anything, it go off an installs in the background.. With this, and the /quiet switch, first you see the files extract, and then the regular install program. I don't want the users to know that it is being installed.
_________________________
You'll never know, unless you ask.
|
Top
|
|
|
|
#189669 - 2008-09-15 05:47 PM
Re: RUNNAS.exe
[Re: Shawn]
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Sadly this does not work. It looks like the RuNNAs.exe does not appear to be able to handle these switches.
Humm now what.
_________________________
You'll never know, unless you ask.
|
Top
|
|
|
|
#189673 - 2008-09-15 07:58 PM
Re: RUNNAS.exe
[Re: Shawn]
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Here are the results.
\\XXX-ADC-03\netlogon\runnas.exe /user:TDOMBROWSKI-XPP\administrator C:\WINDOWS\temp\WindowsXP-KB926139-v2-x86-ENU.exe /quiet /pass:XXXXXXXX
_________________________
You'll never know, unless you ask.
|
Top
|
|
|
|
#189674 - 2008-09-15 08:42 PM
Re: RUNNAS.exe
[Re: Thom]
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Shawn
Just so you know I tried to run the command interactively in dos, with the same results.. It just does not like the /quite switch.. Oh well, I will see if I can figure out another way thanks for the help.. I will check back to see if you had a thought.. thanks again.
_________________________
You'll never know, unless you ask.
|
Top
|
|
|
|
#189677 - 2008-09-15 09:15 PM
Re: RUNNAS.exe
[Re: Shawn]
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Shawn
I think you got it.. I tried what you suggested this morn.. SHELL $runaspath + ' /user:' + @wksta + '\Administrator ' + '"$winpath"' + ' /pass:xxxxxxxx' in $winpath the /quiet was part of it.. that did not work..
I just changed it to the following
$runaspath + ' /user:@wksta\administrator ' + '"$Winpath /quiet"' + ' /pass:xxxxxx'
where /quiet is appended differently.. so far that has worked on my test machine. I will test it elsewhere.. Again thanks for the help.
Edited by Thom (2008-09-15 09:27 PM)
_________________________
You'll never know, unless you ask.
|
Top
|
|
|
|
#189678 - 2008-09-15 09:45 PM
Re: RUNNAS.exe
[Re: Thom]
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
VICTORY....... Thanks.
_________________________
You'll never know, unless you ask.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 557 anonymous users online.
|
|
|