How to access the network from system service.

Articles, advices, FAQ, etc.
Post Reply
Oleg
Site Admin
Posts: 3136
Joined: Thu Jan 01, 1970 1:00 am
Contact:

How to access the network from system service.

Post by Oleg »

The RoboTask service runs in a separate SYSTEM session. By default, the service does not have access to network resources in your local network. However, it is often necessary to have access to network drives or files on another computer in the local network.
There are two ways to resolve this issue.

The first method:
You can run the service with the rights of a registered user. This can be done using RoboTask Service Manager or using the system Service Manager.
The service will automatically obtain the rights of the specified user. If this user has access rights to network resources, then the service will also have access to network resources.
But this method has its disadvantages:
  • The user must have "Log on as a service" rights. This can be set in the security policy editor (Control Panel -> Administrative Tools (or "Windows Tools" in Windows 11) -> Local Security Policy. Then Local Policies -> User Right Assignment -> Log on as a service).
    For users of a domain structure, there is a similar editor for group security policies.
  • The system service automatically loses SYSTEM rights, which are comparable to administrative rights.
The second method:
This method is simpler and more universal. You can log in the SYSTEM session on the desired network resource entirely using the system utility NET.EXE.
The command line is as follows:

Code: Select all

net use \\<ServerName>\<ShareName> <UserPassword> /user:<UserName>
If you are using a local user, then UserName is simply the username on the <ServerName> computer.
If you are using a domain network structure, then you should use a domain user: <DomainName>\<UserName>
You only need to run this command line once. For example, when starting the RoboTask service.

To get more command line options use commands

Code: Select all

net /?
net use /?
You can run this command line using the actions Run Program/Open Document or Run Console Application.
You can insert this command line into the first line of a batch file BAT or CMD. Running this command again will not cause an error.

Read more about service mode here >>
Oleg Yershov
Oleg
Site Admin
Posts: 3136
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: How to access the network from system service.

Post by Oleg »

Starting with version 10.2, the "Login to network share / Map network drive" action has been added to RoboTask.
Oleg Yershov
Post Reply