Remove user from Jenkins via groovy script when role based strategy is used
<p>I am trying to automate Jenkins user deletion. Groovy script which I tried is as below.</p>

<p><code>import hudson.model.User
User u = User.get('rh54')
u.delete()</code> </p>

<p>Mentioned groovy script does not delete when user is LDAP integrated. Also Security realm which is being used is Role-based Strategy.</p>

<p>Please suggest</p>