Created
December 11, 2023 13:00
-
-
Save ravikyada/b4afd0abf1865d3a480689fdb3ef9d25 to your computer and use it in GitHub Desktop.
Create Jenkins User with Script Console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jenkins.model.* | |
import hudson.security.* | |
def instance = Jenkins.getInstance() | |
def hudsonRealm = new HudsonPrivateSecurityRealm(false) | |
hudsonRealm.createAccount("USERNAME","PASSWORD") | |
instance.setSecurityRealm(hudsonRealm) | |
instance.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment