Skip to content

Instantly share code, notes, and snippets.

@bauidch
Last active August 5, 2021 08:18
Show Gist options
  • Save bauidch/a8f245074aa5f77713859f6c1272fce8 to your computer and use it in GitHub Desktop.
Save bauidch/a8f245074aa5f77713859f6c1272fce8 to your computer and use it in GitHub Desktop.
import hudson.model.*
import hudson.security.*
import hudson.tasks.Mailer
def instance = jenkins.model.Jenkins.instance
def user = instance.securityRealm.createAccount("username", "Amin12345#")
user.addProperty(new Mailer.UserProperty("name@mail.com"));
user.setFullName("Full Name")
user.setDescription("Account via groovy generated")
user.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment