[rt-users] Add group membership via CLI

Asif Iqbal vadud3 at gmail.com
Wed May 15 00:25:11 EDT 2013


On Tue, May 14, 2013 at 5:20 PM, Asif Iqbal <vadud3 at gmail.com> wrote:

> while (<FILE>)
> {
>   $user->Load( $_ );
>   $group->AddMember( $user->PrincipalObj->Id );
> }
>

I found the hint from another email with subject CLI Question - Add Users
to group per Scrip from Feb 28, 2007 from Joe Casadonte at oracle.com.

I removed the PrincipalObj and it is working now. So from the script this
is part that I needed to fix.

while (<FILE>)
{
  chop($_);
  $user->Load( $_ );
  $group->AddMember( $user->id );
}

I also had to add more use lib for the extensions to be loaded or failing
to run

use lib '/opt/rt3/local/plugins/RT-Authen-ExternalAuth/lib';
use lib '/opt/rt3/local/plugins/RT-Extension-CommandByMail/lib';




-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130515/87b5a69d/attachment.htm>


More information about the rt-users mailing list