Topic
3 replies Latest Post - ‏2013-06-07T12:01:55Z by CQAdmin
David Suther
David Suther
1 Post
ACCEPTED ANSWER

Pinned topic perl Script needed to create/add user to CQ

‏2013-05-08T17:37:49Z |

Hi All,

Thank you for your help ahead of time!

What I am trying to do in this perl file is prompt the Admin for a New User ID

and an existing group(s)...then add the new user to the group(s) specified.

 

As well as tag the NewUser as LDAP Authenticated.

 

Any help would be greatly appreciated!

 

Thank you,

David

 

  • pdubovitsky
    pdubovitsky
    376 Posts
    ACCEPTED ANSWER

    Re: perl Script needed to create/add user to CQ

    ‏2013-05-09T01:27:36Z  in response to David Suther

    Hi,

    The User Administration Tools for IBM-Rational ClearQuest is able to do what you asked.
    http://cqadmin.org/wiki/User_Admin_Tool

    Pavel

  • DonaldN
    DonaldN
    215 Posts
    ACCEPTED ANSWER

    Re: perl Script needed to create/add user to CQ

    ‏2013-05-09T03:28:39Z  in response to David Suther

    Hi David,

    To create a ClearQuest user with LDAP authentication, you will need to use the AdminSession object method CreateUserLDAPAuthenticated.

    To add a user to a group, you need to use the Group object method AddUser.

    To get input from a prompt when Perl is running, which is a generic Perl function, you can refer to the following link.

    http://www.tizag.com/perlT/perluserinput.php

    - Donald

  • CQAdmin
    CQAdmin
    103 Posts
    ACCEPTED ANSWER

    Re: perl Script needed to create/add user to CQ

    ‏2013-06-07T12:01:55Z  in response to David Suther

    Hello David,

    I have simple one for you-

    #!C:\Program Files\IBM\RationalSDLC\ClearQuest\CQperl.exe

    use CQPerlExt;
    # Create a Rational ClearQuest admin session
    my $adminSession = CQAdminSession::Build();
    # Logon as admin
    $adminSession->Logon( "admin", "adminpassword", "SchemaRepository" );

    # Create the user "jsmith" object

    my $newUserObj = $adminSession->CreateUser( "jsmith" );

    die "Unable to create the user!\n" unless $newUserObj;

    # Set the new user's password to secret

    # Set password is not required since you want to go for LDAP

    # $newUserObj->SetPassword("secret");

    # Subscribing the user to the TEST database
    my $dbs = $adminSession->GetDatabase("TEST");

    $newUserObj->SubscribeDatabase($dbs);

    # All done.

    CQAdminSession::Unbuild($adminSession);

     

    Kind Note - I have not added a line for enabling LDAP authentication for the user. Please refer to CQ API to see how to use it.

     

    All the Best..!!!

    :-)