How can I unregister folders when using a distributed config?

With a centralized config, you would normally run the tank unregister_folders command.
If you are using a distributed config however, you won’t have convenient access to a tank command.
In this situation, the easiest thing to do would be to run a simple python script from the Shotgun Python Console.

How to access the Shotgun Python Console

Here are two example snippets of code showing how to unregister folders.

# Unregister by entity
# ====================
import sgtk

# Get the entities that we want to unregister
# In this example we are unregistering all assets on the project.
entities = tk.shotgun.find("Asset",[["project.Project.id","is",86]])

# Grab the unregister command
unreg_cmd = sgtk.get_command('unregister_folders', tk)

for entity in entities:
    # Now execute the unregister command for each entity we found
    parameters = {"entity":entity}
    print "unregistering: ", entity
    unreg_cmd.execute(parameters)

or

# Unregister all
# ==============
import sgtk

#Grab the unregister command
unreg_cmd = sgtk.get_command('unregister_folders', tk)

# Set the path to point to the root of the project dir.
# This would need to be done per root on the project.
params = {"path":"/sg_toolkit/asite.shotgunstudio.com/my_project"}
print unreg_cmd.execute(params)