IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this forum will no longer be available. More details available on our FAQ.
  • 3 replies
  • Latest Post - ‏2013-06-07T12:01:55Z by CQAdmin
David Suther
David Suther
1 Post

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,



  • pdubovitsky
    376 Posts

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



    The User Administration Tools for IBM-Rational ClearQuest is able to do what you asked.


  • DonaldN
    287 Posts

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


    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.


    - Donald

  • CQAdmin
    103 Posts

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


    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");


    # All done.



    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..!!!