SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Runas Utility

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Runas Utility
Author Message
splasshh



Joined: 07 Feb 2012
Posts: 5
Country: Singapore

Post Runas Utility Reply with quote
Hi,
I'm using this RunAs utility to automate simple "copy" batch job with admin privilege, but encounter error.

Code:
Runas "domain\admin" adminpwd copy O:\logo.jpg C:\Windows\web\wallpaper\logo.jpg


The errors are:
Setting user environment...
Error #1314 loading user profile! Error ignored.
Error #203 setting user environment! Error ignored.
Logged in. Impersonating...
Starting process copy...
Error #2: The system cannot find the file specified.

I'm not sure why it prompts "cannot find the file" while it's obviously there. O:\ is our shared drive.
running the
Quote:
copy O:\logo.jpg C:\Windows\web\wallpaper\logo.jpg
manually with admin account logged on, works fine.

appreciate some pointers.

Thanks.
Tue Feb 07, 2012 3:50 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
O:\logo.jpg - seems to point to a mapped drive name, mapped for your account, not for domain\admin.
Try
Runas.exe "domain\admin" adminpwd copy \\some_server\some_volume\logo.jpg C:\Windows\web\wallpaper\logo.jpg
Tue Feb 07, 2012 5:41 pm View user's profile Send private message
splasshh



Joined: 07 Feb 2012
Posts: 5
Country: Singapore

Post Reply with quote
wow.. good catch.. O:\ is indeed a mapped drive with normal user account.

However, I tried
Runas.exe "domain\admin" adminpwd copy \\some_server\some_volume\logo.jpg C:\Windows\web\wallpaper\logo.jpg

it doesn't work still, with the same error message.


pls help..
Wed Feb 08, 2012 12:09 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
Sorry, another oversight. "copy" is not an executable file name, it is an extension command for cmd.exe, that command works only from the command prompt or if passed as a parameter to cmd.exe.

Runas.exe "domain\admin" adminpwd xcopy \\some_server\some_volume\logo.jpg C:\Windows\web\wallpaper\logo.jpg

or

Runas.exe "domain\admin" adminpwd cmd /C copy \\some_server\some_volume\logo.jpg C:\Windows\web\wallpaper\logo.jpg
Wed Feb 08, 2012 2:41 am View user's profile Send private message
splasshh



Joined: 07 Feb 2012
Posts: 5
Country: Singapore

Post Reply with quote
I found that in some other forum and tried xcopy and cmd /c copy, but still same error :(

Setting user environment...
Error #1314 loading user profile! Error ignored.
Error #203 setting user environment! Error ignored.
Logged in. Impersonating...
Starting process cmd...
Error #2: The system cannot find the file specified.

When I put the /V option it reported as "successfully" but still no file copied.

Runas.exe "domain\admin" adminpwd /V xcopy \\some_server\some_volume\logo.jpg C:\Windows\web\wallpaper\logo.jpg

or

Runas.exe "domain\admin" adminpwd /V cmd /C copy \\some_server\some_volume\logo.jpg C:\Windows\web\wallpaper\logo.jpg

it shows:

Setting user environment...
Error #1314 loading user profile! Error ignored.
Error #203 setting user environment! Error ignored.
Logged in. Impersonating...
Binding new process to the user Desktop...
Starting process xcopy...
Error #0: The operation completed successfully.

but actually the copy process didn't happen.

I'm puzzled
Wed Feb 08, 2012 3:18 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
I suggest creating a batch file and inside batch redirecting output of the copy or xcopy command to a log file, something like
cmd /C copy .... >> c:\copy.log
running that batch file with RunAs and then reviewing the log, it may give you more details, could be a permissions issues for the target file or something else.
Wed Feb 08, 2012 8:58 am View user's profile Send private message
splasshh



Joined: 07 Feb 2012
Posts: 5
Country: Singapore

Post Reply with quote
OK, good idea. I'll try that tomorrow.
I'm pretty sure the permission all are OK, since I can run the copy manually while logging on as Admin. And also it'd throw error like access denied or something.
"cannot find file... " is little bit confusing.

Nevertheless I'll try to frame it in .bat file to test. will share the findings tmr.

thanks.
Wed Feb 08, 2012 10:00 am View user's profile Send private message
splasshh



Joined: 07 Feb 2012
Posts: 5
Country: Singapore

Post It becomes more complex than what I thought it'd be :( Reply with quote
I ran it as batch file and this was what I got:

-----------------------------------------------------------------
RunAs version 2.2.1
Copyright (c) 2003-2007 SoftTree Technologies, Inc.

Logging in as domain\admin...
Setting user environment...
Error #1314 loading user profile! Error ignored.
Error #203 setting user environment! Error ignored.
Logged in. Impersonating...
Starting process test.bat...
Error #1314: A required privilege is not held by the client.

Note: User account running RunAs must be assigned "Act as part of the operation
system" rights and also have "Create token" rights. User account used to run the
process must be assigned "Logon as a batch job" rights.
---------------------------------------------------------------------

The account used is part of the local Administrator group of the client. I checked the local security policy it has the "Logon as batch job" right. But the "Act as part of the operation system" and "Create token" rights by default assigned to "Local System". And based on the error above it seems to indicate that local "Administrators" group doesn't have the privilege.

Now I feel like I'm extending the complexity just to copy a wallpaper logo to user's machine so I can enforce the wallpaper, into adding more GPO to grant my admin account certain rights to all users in that OU, only for the copy process (temporary).

Is this mandatory requirement or any simpler alternative for me?

Thanks in advance for advice
Sun Feb 12, 2012 10:08 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7841

Post Reply with quote
Yes, it is a requirement, yet fortunately simple, only a few clicks are required to set the privileges and then just logoff/logon or restart. And also please keep in mind that local "Administrators" group doesn't have many privileges, only a bare minimum is given to the group to enable it to perform basic admin functions and nothing else. If you want an admin account to create processes on behave of other users, that account must have "act as part of OS privilege." If you take a second look at the required privileges, you will find them kind of expected.
Mon Feb 13, 2012 12:11 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.