Recovering Policies that have Disappeared

When Policies Disappear...

Many MSPs have complained recently about policies (and possibly other objects) disappearing when they are moved within a specific group, or moved and dropped into a group. If you are on On-Prem VSA user, the following SQL queries can be used to recover these objects. The queries can also be provided to support if your VSA is hosted in SaaS - they will need to be adjusted for the proper tenant ID.

The problem

...occurs when you try to move an object within a folder (change the display order) or move an object into a different folder. This causes the object to "disappear". The problem, specifically, is that the objects within a folder are identified by a folder path and a parent ID. The two usually match, but the current bug seems to change the parent ID value. This prevents the object from appearing in the folder location even though it is identified as belonging in that folder path.

Workarounds

Until the problem is fixed, don't manually re-order objects within a folder, no matter how much it bothers your desire for order and structure! :)

If you need to move an object into another folder, drop it onto the folder icon directly, not into the folder in-between other objects. If you hold the object over the folder icon momentarily, you'll notice a small flash - the text switches to italic and back to normal. This indicates that the target has been validated - that's when it is OK to drop the object.

Recovery

There are two methods for recovery, and both work equally well. Choose one or the other based on your comfort level with performing SQL Queries on your VSA.

Non-SQL Method

This method takes a bit longer and is a bit more invasive, but requires no skill with running SQL update queries.

  1. Export ALL the objects from the folder containing the missing object via Import Center - the missing object should be visible there!

  2. Edit the exported XML - compare the "missing" object with the other objects - the "parentId" will probably be different for the missing object. Update the parentId value to match the other records.

  3. Delete the original folder with all objects. Deleting the folder will also delete the hidden objects.

  4. Import the edited XML file. It should return all objects, including the missing one.

SQL Update Query Method

This method is fast and the results immediate, but does require understanding of the SQL commands to locate and then update the "parentId" field with the correct value. Please be sure you have good backups and are familiar with SQL queries before choosing this method!

  1. Run the following Query to list all of the objects in the specific folder where the missing object should be:
    SELECT * FROM tree.treenode WHERE treeFullPath LIKE '%<FOLDER_PATH>%'
    where "<FOLDER_PATH>" contains enough of the folder path to uniquely identify it. In our case, the folder's unique name had "Agent Settings (" in it, so that's what we used. This will return a list of all of the objects in that folder, including the missing one(s). Take note of the objects that have matching treeNodeTypeFK values, then locate the missing objects. These will have a different parentID value from the other objects that are visible in the folder. Identify and record the parentID value of a visible object.
  2. Define the following query, but do not execute it yet!
    UPDATE [ksubscribers].[tree].[treenode] SET parentId = <parent>
    WHERE ref LIKE '<policy name>'
  3. Edit the query:
    1. Replace "<parent>" with the parentID value determined in step 1 - this is the Parent ID of the visible objects.
    2. Replace "<policy name>" with the name of the missing policy.
  4. Confirm that you are replacing the parentID value on the record where the ref field matches the specific missing object, then execute the query.
  5. Re-run the query in step 1 to verify that the missing object now has the correct parentID value.
  6. Check the VSA to confirm that the object is once again visible in the correct folder.

Steps 3.2, 4, and 5 can be run for additional missing objects in the same folder. Repeat all of the steps to recover missing objects from other folders.

In our testing with System Policies, the missing policy reappears  in it's original location after performing the above steps and the VSA page is refreshed.

NOTE

MSP Builder does not assume any liability for issues that arise through the use or misuse of this process. It is assumed that you are comfortable with VSA administration and qualified to perform the techniques presented herein.

No Comments

Add a Comment