IBM Support

How to find the number of active users in IBM Rational ClearQuest using a VB script

Question & Answer


Question

How do you write a Perl hook in IBM Rational ClearQuest to get the record ID and write it into a new field with some prefix?

Cause

You would want to count the number of ClearQuest Active users at any point of time to provide a quick solution for Admin/Management to maintain correct metrics/Stats.

Answer

The VB Script below uses the ClearQuest API and can be run on Windows.
Note: The ClearQuest Client must be installed on this machine.

This script iterates through all the ClearQuest users and shows a message box with total number of active users.

Procedure:

  1. Save the following VB script text to notepad and save with a .vbs extension.

    ********************************************************************
    dim adminSession
    dim dbObj
    dim groupObj
    dim Activeusers

    Activeuser = 0

    set adminSession = CreateObject("CLEARQUEST.ADMINSESSION")
    set SessionObj = CreateObject("ClearQuest.Session")

    ' provide correct login details

    adminSession.Logon "admin", "<adminPasswd>", "<SchemaRepositoryName>"

    set userList = adminSession.Users
    For each userObj in userList

    userName = userObj.Name

    Isactive = userObj.Active

    if Isactive = TRUE then

    Activeusers = ActiveUsers + 1

    End If

    Next

    MsgBox "Total number of Active users are " & Activeuser


    *******************************************************************

  2. Run this script-

  • 32-bit Operating System > Double click on the file

  • 64-bit Operating System > Copy the .vbs file to C:\Windows\SysWOW64 directory.
    C:\Windows\SysWOW64>wscript.exe <filename>.vbs

     
    Disclaimer

    All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Internal Use Only

No

[{"Product":{"code":"SSSH5A","label":"Rational ClearQuest"},"Business Unit":{"code":"BU004","label":"Hybrid Cloud"},"Component":"API","Platform":[{"code":"PF033","label":"Windows"}],"Version":"8.0.1","Edition":""}]

Document Information

Modified date:
16 June 2018

UID

swg21666557