Deleting multiple items from Ghost Solution Suite console Shortcuts View
search cancel

Deleting multiple items from Ghost Solution Suite console Shortcuts View

book

Article ID: 282357

calendar_today

Updated On:

Products

Ghost Solution Suite

Issue/Introduction

The Ghost Solution Suite console has a built in 'Shortcuts View' which can be helpful for quickly accessing jobs, tasks, or computers that are placed in the view. The view can be toggled on in the console by selecting 'View' > 'Shortcuts View'.

The console allows selecting or highlighting multiple objects and dragging/dropping to the Shortcuts View pane. However, if multiple items from 'Shortcuts View' need to be removed, they must be removed one at a time via right-click > 'Remove from Shortcut bar'.

If a large amount of items need to be removed from 'Shortcuts View', removing these items one at a time can be very time consuming.

Environment

GSS 3.3 (all release update versions)

Cause

Console/product limitation

Resolution

Multiple items can be removed from the Shortcuts View in the database using SQL queries in SQL Management Studio.

These steps should be performed only if you have an understanding of basic SQL statements. Please backup the Ghost Solution Suite database prior to attempting this. These steps are performed at your own risk and with a user with DBO rights. Deleting items from the Shortcut View using these steps will remove the item from Shortcut View only. It will not delete the item completely from the console. 

  1. Open SQL Management Studio and connect to the SQL instance hosting the GSS database. The default DB name is eXpress.

  2. Close any open instances of the Ghost Solution Suite console. This must be done for any consoles logged in for the user you wish to clean up shortcuts for.

  3. Back up the GSS database. Right click on the database, select 'Tasks' > 'Back Up...'

  4. Click on eXpress db (or custom name if defined), select 'New Query'

  5. First locate the user_id for the user which needs their Shortcuts View cleaned up. If users are not defined in the GSS console, the default user_id is '0'

    Run the following query replacing username with the user that needs their shortcuts cleaned up. (example: 'John')

    SELECT user_id FROM [eXpress].[dbo].[securityuser]
    WHERE name = 'username'

  6. Copy the user id from 'user_id' column. This is usually an 8 digit number starting with '14'

  7. The following query will show ALL shortcut items for a specific user id. (Replace 14000000 with the 'user_id' captured in step 6):

    SELECT * FROM [eXpress].[dbo].[shortcut]
    WHERE user_id = 14000000

  8. Determine the 'item_type' number for the items you would like to remove from the Shortcuts View

    NOTE: Item types specified in [eXpress].[dbo].[shortcut] table are as follows:

    item_type 1 - Default computer groups
    item_type 2 - Custom computer groups
    item_type 3 - Computer records
    item_type 4 - Job folders
    item_type 5 - Jobs 

  9. Here are some example queries to view and delete different item types for different user id's. Please verify information in 'SELECT' statements are expected before running any 'DELETE' statements.
  • View then remove ALL computer records from Shortcut View for user id 14000000:

    SELECT * FROM [eXpress].[dbo].[shortcut]
    WHERE user_id = 14000000 AND item_type = 3

    DELETE FROM [eXpress].[dbo].[shortcut]
    WHERE user_id = 14000000 AND item_type = 3


  • View then remove ALL jobs from Shortcut View for user id 14000000:

    SELECT * FROM [eXpress].[dbo].[shortcut]
    WHERE user_id = 14000000 AND item_type = 5

    DELETE FROM [eXpress].[dbo].[shortcut]
    WHERE user_id = 14000000 AND item_type = 5

  • View then remove ALL computer records containing 'COMP' in item_name and added to Shortcut View for user id 14000000:

    SELECT * FROM [eXpress].[dbo].[shortcut]
    WHERE user_id = 14000000 AND item_type = 3 AND item_name LIKE '%COMP%'

    DELETE FROM [eXpress].[dbo].[shortcut]
    WHERE user_id = 14000000 AND item_type = 3 AND item_name LIKE '%COMP%'

  • View then remove ALL computer records beginning with 'COMP' in item_name and added to Shortcut View for user id 14000000:

    SELECT * FROM [eXpress].[dbo].[shortcut]
    WHERE user_id = 14000000 AND item_type = 3 AND item_name LIKE 'COMP%'

    DELETE FROM [eXpress].[dbo].[shortcut]
    WHERE user_id = 14000000 AND item_type = 3 AND item_name LIKE 'COMP%'

  • View then remove ALL computer records ending with 'COMP' in item_name and added to Shortcut View for user id 14000000:

    SELECT * FROM [eXpress].[dbo].[shortcut]
    WHERE user_id = 14000000 AND item_type = 3 AND item_name LIKE '%COMP'

    DELETE FROM [eXpress].[dbo].[shortcut]
    WHERE user_id = 14000000 AND item_type = 3 AND item_name LIKE '%COMP'

  • View then remove ALL computer records in comma separated list and added to Shortcut View for user id 14000000:

    SELECT * FROM [eXpress].[dbo].[shortcut]
    WHERE user_id = 14000000 AND item_type = 3 AND item_name IN ('computer1', 'computer2', 'computer3', 'computer4')

    DELETE FROM [eXpress].[dbo].[shortcut]
    WHERE user_id = 14000000 AND item_type = 3 AND item_name IN ('computer1', 'computer2', 'computer3', 'computer4')


Queries above are given as an example only and should be modified to match specific removal needs. Please consult your DBA for further assistance.