Can't reach IP adress within Jenkins Pipeline Script

So I have a .bat file that turns on a Computer. When I run it with cmd outside of Jenkins it works. The given IP Adress is reachable. But when I run the .bat file within Jenkins the IP adress seems to be not reachable.

Jenkins is installed locally. I tested it on the same machine where Jenkins is installed.

Is the user you run as when you login and run the bat file the same user as the Jenkins controller/agent where the job is running is running as? Can you share any error messages?

2 Likes

Thanks for the Response :pray:

How do I check on which user Jenkins is running on?

I had a look at the Jenkins Service and it uses the Local System Account.
image
There is only one account on the Machine and I tried the “This account:” option to but the Jenkins service would fail starting the service.

Error 1069: The service did not start due to a logon failure.

I can’t share the exact error message, but it has something to do with not reaching an IP Address.

And again on the same machine it works when running the .bat file in the command line :confused:

Running Jenkins as Local System is not recommended. In would recommend setting up a user for Jenkins to run as. This user will need to have Logon As Service permissions. You can see how to do that here: Windows

Sometimes the Local System account can cause issues.

Thanks @slide_o_mix!
I could sign in with a User now.
One thing was necessary that the documentation didn’t mentioned.
The user the Service uses, needs to have a windows password.

I’ll make another reply if everything went smoothly.

1 Like

That did the trick. The Service needs to use the User.