#193534 - 2009-04-22 01:00 AM
Using runnas.exe in script
|
Curious
Getting the hang of it
Registered: 2004-02-16
Posts: 61
|
I've been looking at some threads, one where the introduction of runnas.exe was discussed through several pages.
Also I've read runnas with parameters
The last one is doing exactely what I want to do:
implement the /quiet switch into the runnas execution.
I've tried every possibility (I think) I first thought that ver 1.14 of runnas.exe was an old one, but it seems this is the last?
The syntax in the script is as follows: ----------- $winpath = "c:\delnvc.exe /quiet" $user = "/user:jen" $pass = "/pass:xxxx" $runaspath = "c:\runnas.exe" +' $user' + '" $winpath"' + ' $pass'
Shell $runaspath ---------- The syntax seems to work, no errors, but the delnvc /quiet doesn't appear as a process in the overview, and doesn't run.
If I run the command directly from the cmd, the process appear in the process-overview.
I've tried with and without the /quiet- bit in $winpath, instead using it in the $runpath (as suggested as a solution in the thread mentioned above), like this: ---------- $winpath = "c:\delnvc.exe" $runaspath = "c:\runnas.exe" +' $user' + '" $winpath /quiet"' + ' $pass' ---------- But the same problem
If I run the runnas directly from cmd like this: -- runnas.exe /user:jen "c:\delnvc.exe /quiet" /pass:xxxx same thing happens: No errors, but the process doesn't start --
If I remove the /quiet in that last sentence: like this: -- runnas.exe /user:jen-265-6910P\jen "c:\delnvc5_1.exe" /pass:xxx -- then everything works as intended. But since it doesn't run in the backgroud, it isn't working like I want.
What am I doing wrong, anybody?? Or isn't it possible to make the script do what I want?????
Regards Jon
_________________________
I was placed on earth to do a job. Right now I have so much to do, I will never die..
|
|
Top
|
|
|
|
#193545 - 2009-04-22 04:23 PM
Re: Using runnas.exe in script
[Re: NTDOC]
|
Curious
Getting the hang of it
Registered: 2004-02-16
Posts: 61
|
I've dug a bit deeper into the problem today, and the solution so far seems to be: - The delnvc.exe must be on local disk at the computer (not using unc-path)
- I tried using authentication through a user on the domain, instead of using a local admin on the computer.
To sum up: When the exe-file is placed locally on the computer, along with using a local admin (eg. @wksta\administrator) everything works ok.
Then I guess I gotta make a script which generates a locally user with admin-privileges to use in the script.
Jon
_________________________
I was placed on earth to do a job. Right now I have so much to do, I will never die..
|
|
Top
|
|
|
|
#193565 - 2009-04-23 02:55 PM
Re: Using runnas.exe in script
[Re: NTDOC]
|
Curious
Getting the hang of it
Registered: 2004-02-16
Posts: 61
|
My mistake:
The computer where I developed the script had deleted the 'domain admin' in the local administrator-group.
This caused all the problems.
The script is now completed, and does what I want.
Jon
_________________________
I was placed on earth to do a job. Right now I have so much to do, I will never die..
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 699 anonymous users online.
|
|
|