Run as on 2008 R2

Discuss RoboTask here
Post Reply
KeesB
Posts: 9
Joined: Sat Aug 08, 2009 7:13 pm
Location: Netherlands
Contact:

Run as on 2008 R2

Post by KeesB »

We are running Robotask as a service on a W2k8r2 server. We
have set the user for tasks, but if we run a task, it seems
to run as the local user (we use for the service). I
checked that running a batch file displaying username.

Any ideas would be appreciated.
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Run as on 2008 R2

Post by Oleg »

How did you set up RoboTask Service: under system account or under some user account?
If you use user account, then RoboTask process and each task will use specified user settings and rights. If you run batch file, environment variable %USERNAME% will contain specified user name.

Under system account variable %USERNAME% always contains "SYSTEM" string.
KeesB
Posts: 9
Joined: Sat Aug 08, 2009 7:13 pm
Location: Netherlands
Contact:

Run as on 2008 R2

Post by KeesB »

It's setup to run as local system as otherwise the console
cannot be accessed (using thespecial service to detect the
UI in Windows 2008).

The username actually contains the name of the machine it
is running on.

Kees
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Run as on 2008 R2

Post by Oleg »

Excuse me, I mistook.
Environment variable %USERNAME% contans %COMPUTERNAME%$ within system account under Vista, 7, 2008

Under XP, 2003 (and earlier) variable %USERNAME% is absent in system account.

System variable of RoboTask {UserName} contains "SYSTEM" string within system account.
KeesB
Posts: 9
Joined: Sat Aug 08, 2009 7:13 pm
Location: Netherlands
Contact:

Run as on 2008 R2

Post by KeesB »

Hi Oleg,

I checked that. The ROBOTAKSK UserNamer contains the
right ID (SA_ROBOTASK), but the specific problem is it
will not print to a specific printer while it will print
when I log in interactively to the macine using the same
ID.

The (external) sysops blame it on a usetr problem.

Is there a quick way (in 2008) to verify in a batch file
what user I am??

Kees
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Run as on 2008 R2

Post by Oleg »

RoboTask works within SYSTEM environment in service mode.
But it can acquire rights of some user if you specify logon parameters (Options -> NT Service)
RoboTask applies these rights for each task thread when it starts the task.

If you run another application (Run program/Open document action) the program inherits RoboTask's environment without additional rights. Therefore your batch file woks in SYSTEM environment.

If you want to run process with another user rights you should use "Run program as user " action (see in For Windows NT group)
KeesB
Posts: 9
Joined: Sat Aug 08, 2009 7:13 pm
Location: Netherlands
Contact:

Run as on 2008 R2

Post by KeesB »

Oleg,

Thanks for the help.

The Run Program As User (NT Group) always gives "Invalid
parameter", even if there is no parameter (and all I do is
say start a batch file to do a DIR and Pause), so I aborted
that route.

Kees
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Run as on 2008 R2

Post by Oleg »

Send your task/example to me, please (oleg(at)robotask.com)
I've just tested this action with batch file in service and application mode without problems.
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Run as on 2008 R2

Post by Oleg »

In addition:
Try to turn OFF "Logon task as user" parameter of the task. Find it on "Advinced" tab of task editor.
By default it is ON, but it can hamper in executing "Run as User" if you use logon parameters.

Run As User action should have all rights, i.e. it must work with SYSTEM rights.
KeesB
Posts: 9
Joined: Sat Aug 08, 2009 7:13 pm
Location: Netherlands
Contact:

Run as on 2008 R2

Post by KeesB »

No change, unfortunately. Mailed the task.

Kees
Post Reply