Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in DevOps and Agile by (1.5k points)
edited by

We are using Jenkins on Windows-8 x64 for building [MSBuild], Packaging [cspack], Running [csrun], and Testing (nunit) a project of azure cloud services. The emulators of Azure cloud service have to run as an administrator, also, we need to bind to the ports 80/443. So, we cannot use the 'lite' emulators. 

We did it using a .bat file that the Jenkins runs. Usually, no user will log into the machine, the machine will boot up and the Jenkins run as a service which will monito our git repository and shall email on encountering failures. The admin will log into the machine manually just for the maintenance part like applying patches or rebooting the machine. 

How can we configure the Jenkins for running the .bat file as an admin without involving any human interaction? 

The steps I want to achieve : Using a desktop User Interface, we have to run the cmd prompt as administrator, should acknowledge UAC prompt, get elevated-privilege-prompt, and then run the .bat file. 

Can this be done?



 


 

closed

1 Answer

+1 vote
by (7.5k points)
selected by
 
Best answer

Try running Jenkins' service as another local administrator user. Upon installing the Jenkins, go to the "services.msc",  scroll down to Jenkins service, check on the properties, check on the "log on", and then to  "this account" . Now, you can specify a local admin account.

Hopefully, in the newer Jenkins' builds, this could work as the standard NETWORK SERVICE, but for some unknown reason, it did not work with our box.

You can find this jenkins cheat sheet of help for more about jenkins.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...