A user is displaying on the count in administration search but is not visible.

Version 3

    Verified Product Versions

    LANDESK Service Desk 7.6

    Problem

     

    A user is not displaying in the administration search however they are displaying on the count of users for the search. If this problem exists it can also prevent the metadata manager from running.

     

    Solution

     

    The following script will resolve this.  It ensures that all records in the tps_user table have corresponding rows in the tps_analyst, tps_end_user, tps_account_manager or tps_contact tables, where appropriate.  Both Account Manager and Analyst inherit from End User so they need to appear in tps_end_user as well as their own tables and tps_user.

     

     

     

    INSERT INTO tps_contact(tps_guid)

              SELECT tps_guid FROM tps_user WHERE tps_user_type_guid =

              (SELECT tps_guid FROM tps_user_type WHERE tps_name = 'Contact')

                        AND tps_guid NOT IN (SELECT tps_guid FROM tps_contact);

     

    INSERT INTO tps_analyst(tps_guid)

         SELECT tps_guid FROM tps_user WHERE tps_user_type_guid =

              (SELECT tps_guid FROM tps_user_type WHERE tps_name = 'Analyst')

              AND tps_guid NOT IN (SELECT tps_guid FROM tps_analyst);

     

    INSERT INTO tps_account_manager(tps_guid)

              SELECT tps_guid FROM tps_user WHERE tps_user_type_guid =

                        (SELECT tps_guid FROM tps_user_type WHERE tps_name = 'AccountManager')

                        AND tps_guid NOT IN (SELECT tps_guid FROM tps_account_manager);


    INSERT INTO tps_end_user(tps_guid)

         SELECT tps_guid FROM tps_user WHERE tps_user_type_guid IN

              (SELECT tps_guid FROM tps_user_type WHERE tps_name IN ('EndUser', 'Analyst', 'AccountManager'))

              AND tps_guid NOT IN (SELECT tps_guid FROM tps_end_user);

     

     

     

     

    The script above should run sucessfully for both SQL and Oracle databases.  This should be run by your database administrator and tested against a test copy of your database before applying live. When you apply to the live database, please ensure that no-one else is logged in and that a backup of the database has been taken. In the event of any problems you should restore from the backup copy.

     

    It is not clear exactly how the problem occurs that user records are not in the correct tables, at present it is assumed that direct alteration to the database is the root cause.  Should you encounter this problem please log it with your Support provider so that we can work towards identifying if there is a problem.