<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaTempEditStyle"></style><style title="owaParaStyle"><!--P {
MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
<meta content="MSHTML 6.00.6001.18000" name="GENERATOR">
</head>
<body ocsi="x">
<div style="FONT-SIZE: 13px; COLOR: #000000; DIRECTION: ltr; FONT-FAMILY: Tahoma">
<div></div>
<div dir="ltr"><font face="Tahoma" color="#000000" size="2">Hi, Even on CLI : ./rt-shredder --plugin 'Objects=User,39236'<br>
</font></div>
<div dir="ltr"><font face="Tahoma" color="#000000" size="2"><font face="tahoma">Is taking forever. It has been running for quite sometime till now.</font></font></div>
<div dir="ltr"><font face="Tahoma" color="#000000" size="2"><font face="tahoma"></font></font> </div>
<div dir="ltr"><font face="Tahoma" color="#000000" size="2"><font face="tahoma">-Ashish</font></div>
</font>
<div id="divRpF929725" style="DIRECTION: ltr">
<hr tabindex="-1">
<font face="Tahoma" color="#000000" size="2"><b>From:</b> Potla, Ashish Bassaliel<br>
<b>Sent:</b> Tuesday, February 23, 2010 6:30 PM<br>
<b>To:</b> rt-users@lists.bestpractical.com<br>
<b>Subject:</b> Delete User accounts through a perl script<br>
</font><br>
</div>
<div></div>
<div>
<div style="FONT-SIZE: 13px; COLOR: #000000; DIRECTION: ltr; FONT-FAMILY: Tahoma">
<div></div>
<div dir="ltr"><font face="Tahoma" color="#000000" size="2">Hello I consistently keep getting this error : Couldn't wipeout object: at /opt/prj/rt/rt3/local/lib/RTx/Shredder.pm line 427.</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">At the end of this mail is my subroutine -
</font></div>
<div dir="ltr"><font face="tahoma" size="2">If I change the Wipeout to WipeoutAll , it just takes on forever at that statement.</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">Let me know if you have any other logic to delete user accounts from a perl script.</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr"><font face="tahoma" size="2">Please Help,</font></div>
<div dir="ltr"><font face="tahoma" size="2">Thanks</font></div>
<div dir="ltr"><font face="tahoma" size="2">-Ashish</font></div>
<div dir="ltr"><font face="tahoma" size="2"></font> </div>
<div dir="ltr">sub delete_user {</div>
<div dir="ltr"> # Grab the user id<br>
my $id = shift;<br>
<br>
# Form an RT::User object string for the user<br>
my $object_string = 'RT::User-' . $id;</div>
<div dir="ltr"> # Create a single item array with the object string<br>
my @users_to_delete = ($object_string);<br>
<br>
# Create a shredder object and pass it the array<br>
my $shredder = new RTx::Shredder( force => 1 );<br>
$shredder->PutObjects( Objects => \@users_to_delete );<br>
<br>
# Shred the user<br>
eval {<br>
$shredder->Wipeout<br>
};<br>
<br>
if ( $@ ) {<br>
return (-1, "Failed to delete user with id '$id': $@");<br>
}</div>
<div dir="ltr"> return (1, "User with id '$id' deleted successfully.\n");</div>
<div dir="ltr">}</div>
</div>
</div>
</div>
</body>
</html>