[rt-users] Finding out if a user has been merged

Kevin Falcone falcone at bestpractical.com
Tue Apr 23 11:02:07 EDT 2013


On Mon, Apr 22, 2013 at 02:44:40PM -0400, Komarinski, Mark F. wrote:
> Our Active Directory environment contains a list of email aliases for
> a user that I can query against, so I'd like to come up with a way of
> going through that database and merge users in RT to the primary
> account name. I've already installed RT-Extension-MergeUsers and can
> do it by hand, but doing this in an automated fashion would be better
> given the thousands of users we have and skip over accounts that have
> already been merged.

I'm not sure if you actually want to be checking GetMergedUsers or
looking at the EffectiveId attribute instead, but I see at least 2
problems in the code:

>     my $merged_users = $merge_user->GetMergedUsers;
>     if (grep { $_ == $email_address } @{$merged_users->Content} ) {
>       print "Accounts already merged: $email_address in $account\n";
>     }

Content is a list of ids, not Email Addresses and you can't use the
numeric compare (==) on a mixed number and string without really weird
results.

-kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 235 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130423/c68685ec/attachment.sig>


More information about the rt-users mailing list