Thursday, October 11, 2012

Jenkins Slave and Domain user profile

Jenkins has a neat feature of configuring your Windows Slave to run as a domain user. This is important feature when you have a configuration set for a particular user in the domain and you need to use that profile when you start the slave from. This pretty well works if followed the exact steps as mentioned in jenkins wiki and forum, how ever I couldn't get this working right may be I was missing few steps there. 

In my case, Mapped network drive was not available when I run a windows batch command from jenkins.
I did some debugging using a simple Job which prints the path and the %username%, I found that Jenkins Slave was running as admin account. So now I have the root cause being found, I headed to stackoverflow, found dozens of people having similar issue, followed all the possible solution provided by experts there, but non worked for me. With hope of finding some answer I explored jenkins service on my slave machine, interestingly I found a parameter Log on as:... , it was clear that if I could give the domain user details here, the slave would start with domain user credentials. This one Step solved my hour long problem. 

No comments: