jenkinsgroovyjenkins-cli

Jenkins Disable CLI over Remoting via a Groovy Script


Is is possible to disable Jenkins CLI over Remoting option via Groovy script? I want to put the script into init.groovy.d so that is option is disabled upon start up so I am not prompted to disable it

Thanks


Solution

  • you can do it like this (jenkins2.60.2)

    import jenkins.model.Jenkins
    
    jenkins.model.Jenkins.instance.getDescriptor("jenkins.CLI").get().setEnabled(false)
    

    Regards