ArcGIS Activity Log and Admin Tools for ArcGIS – A Path to Item Ownership Recovery

Recently, we were contacted by someone who had a problem. An individual with administrative access to their ArcGIS Online Organization had accidentally moved ownership of ALL ITEMS to themself.

This needed to be fixed immediately. Changing the ownership of all items individually would have been too time-consuming to be a practical solution. Additionally, an ArcGIS Online account rollback was not a possibility. Luckily, an ArcGIS Activity Log was available.

If you’re reading this blog post, you’re either glad that situation isn’t happening to you, or it HAS happened to you. If it has happened to you, then you want me to skip the narrative, and provide the solution. You probably also want your inbox notification number to stop ticking up like it’s the current Powerball payout. Fair enough:

Enter: Admin Tools Pro

By combining the informative entries in an ArcGIS Activity Log, and using the power of Admin Tools for ArcGIS CSV tools, ownership of items were returned within one CSV Import.

What’s Needed (References)

From the Activity Log, the request column contains the information you would need to return ownership. Here’s a value from the request column for the transfer of item ownership:

/sharing/rest/content/users/{original_user_id}/{folder_id}/items/{item_id}/reassign

NOTE: The folder_id part of the request will be missing if the item is stored in the root folder of the original user.

NOTE: In the Activity Log, the owner column contains the current owner user name (incorrect owner) and the actor column contains the user name of the account that performed the action.

Summary of Procedure

Loop through the CSV items in the activity log.

For each re-assign statement in the request column made by the username in the actor column, assign it to the correct value in the owner column in a second CSV, produced using Admin Tools for ArcGIS. You’ll be importing the second CSV into Admin Tools to make bulk edits to ownership.

Note: The requests may appear to repeat in the activity log (i.e. there will be two reassign requests per item transfer). These identical requests will have the same reqId value. You can ignore the duplicates.

Operational Steps:

Download and Clean ArcGIS Activity Log

Download and Clean ArcGIS Activity Log

  • Log into the ArcGIS Online or Portal.
  • Click on the Organization menu item at the top of the page.
  • Then click on the Overview tab under name of the organization.
  • Then click on “Download activity log” link under the organization logo.
  • Open the CSV and scrub out duplicate entries. These entries will have identical values in the reqId column.

In Admin Tools:

  • Open the Export Items to CSV tool
  • Select 1 or 2 items (doesn’t matter what, these items will be replaced) and click Next
  • On the next step, turn OFF all fields, then turn ON the following fields: ID, Owner, Folder ID (optional fields: Groups if you know which groups to reassign them to.). Click Next.
  • Export, and download the CSV.
  • Keep the column headings, but delete the entries. This CSV will be the one to import.

In Activity Log:

  • Sort by request Column
  • Search for reassign statements in the request column (Example: /sharing/rest/content/users/{original_user_id}/{folder_id}/items/{item_id}/reassign)
  • Copy the Item IDs from the id column in the Activity Log and paste into the id column of the CSV from Admin Tools (replacing temporary placeholder item records from export)
  • Attribute them by applicable owner name in owner column of the CSV from Admin Tools, referencing the username in the request column of the Activity Log.
  • If item is in a folder, the folder id will be right after the user name in the request column:
    • /sharing/rest/content/users/{username}/{folder_id}/items/{id}/reassign (with folder)
    • /sharing/rest/content/users/{username}/items/{id}/reassign (no folder)

Copy that folder_id value to the ownerFolder field of the CSV from Admin Tools if it is present. Otherwise, leave it blank.

  • Repeat until all items have been added to correct owners.
  • Save the document (ensuring it’s still saved in a CSV format)

In Admin Tools:

  • Open the Import Items from CSV tool.
  • Browse and open the CSV with new edits, that you saved
  • Import, and the ownership of all your items should be back to their original owners.

With Admin Tools for ArcGIS and the ArcGIS Activity Log, this person was successful in recovering the ownership of all the items in their ArcGIS Online Organization.

Interested in more tips and useful technical support docs? Then be sure to consult our Knowledge Base (KBase)

See Also:

Head of Customer Support