[rt-users] how to disable user account in rt via script

Gene LeDuc gleduc at mail.sdsu.edu
Mon Oct 29 12:58:38 EDT 2007


Hi Noura,

There is a method in RT::User called SetDisabled that will probably do what 
you want.  Try loading the user you want to disable into a user object and 
then call the method like this:

   my $UserId = #### user id of the user you want to disable #####
   my $user = RT::User->new($RT::SystemUser);
   $user->Load($UserId);
   $user->SetDisabled();

I don't know what might happen if you do this to the current user (the 
person logged in to RT).

Good luck,
Gene

At 07:22 PM 10/28/2007, Noura Elhawary wrote:
>Hi all,,
>
>I am trying to write a perl script to disable rt user account, so the
>script should perform a task similar to unchecking the checkbox "Let
>User Access RT" in the rt web ui. Can you please advise me what is the
>best way to do so , or if there is a perl module that has some functions
>to do that?
>
>Thanks,
>Noura
>
>_______________________________________________
>http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
>SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:
>
>If you sign up for a new RT support contract before December 31, we'll take
>up to 20 percent off the price. This sale won't last long, so get in touch 
>today.
>     Email us at sales at bestpractical.com or call us at +1 617 812 0745.
>
>
>Community help: http://wiki.bestpractical.com
>Commercial support: sales at bestpractical.com
>
>
>Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>Buy a copy at http://rtbook.bestpractical.com


-- 
Gene LeDuc, GSEC
Security Analyst
San Diego State University 




More information about the rt-users mailing list