SCO 2012: Updating the stored procedures in the database to remove deleted objects from the Authorization Cache


As you might know, Orchestrator never deleted anything from the database, instead it marks the object as deleted.

Ryan talks about it in this blog post about undeleting objects. Read more here

In my Lab environment I import and delete a lot of runbooks.

A couple of weeks ago i hit a point where the web service did not show all objects. After a thorough investigation i found out that the authorization cache was too big to be generated within the giving time. Therefore the web service would timeout before the cache was complete.

I tried to delete objects, but it did not help. By checking the database i found out that the authorization cache was generating entries for all objects, even the ones that were already deleted!

so i checked the stored procedures in the data store, and found out that it was in fact using a query that included all objects.

To fix this problem i have changed the stored procedures inside the data store:

Here is my new version of the procedures:


and the other procedure:



All i have added to the procedure queries is

after you have changed the procedures, wait 10+ minutes for the authorization cache to update or force the update by using this guide:

Now it works and i have no problems.

But please remember

Changing the data store is NOT supported, and this solution should only be used in Lab environments.

Please do not hesitate to post any comments about the solution ūüôā

By | 2013-04-23T19:33:49+00:00 April 23rd, 2013|Automation|1 Comment

About the Author:

Jakob Gottlieb Svendsen

Twitter: @JakobGSvendsen

Jakob Gottlieb Svendsen is a Microsoft Cloud and Data Center Management MVP (, Working as Global Lead Developer, Senior Consultant and Trainer at CTGlobal, where he is one of the driving forces in keeping CTGlobal a System Center Gold Partner and member of the System Center Alliance.

Since he started at Coretech in 2007, he has focused on Scripting and Development, primarily developing tools, extensions and scripts for the System Center Suite. His main area is Automation (including OMS/Azure Automation, Service Management Automation, PowerShell and Orchestrator). Another area is Windows Azure Pack / Azure Stack, where he does implementation, development, workshops and presentations. He is a world-wide renowned voice in the Automation field.

He is passionately devoted to the community, to which he contributes by being a moderator at TechNet and sharing his knowledge at

  • Co-founder: PowerShell User Group Denmark
  • Speaker at MMS 2016, Minneapolis (
  • SCU Europe 2014, 2015, 2016 (
  • Microsoft TechEd North America 2014, Houston
  • NIC 2012,2013,2014,2015, Oslo (
  • Microsoft CampusDays 2011, 2013, Copenhagen
  • Microsoft TechDays 2015, Sweden (
  • Microsoft Partner Event: New in SC2012 SP1
  • User group meetings (PSUG.DK , SCUG.DK/BE/NO, AZMUG + more)
  • Microsoft Certified Trainer.
  • Microsoft Scripting Guys Forum Moderator

Main working areas:

  • Automation (Azure Automation, SMA, SCO)
  • Windows Azure Pack / Azure Stack
  • System CenterVisual Studio Team Services / Team Foundation Server
  • Development:C#.Net, VB.NET, VBScript, PowerShell, Service Manager, OpsMgr, ConfigMgr
  • Orchestrator
  • Windows Azure Pack / Azure Stack


  • Azure Automation
  • Service Management Automation
  • System Center Orchestrator
  • PowerShell, VBScript, C#.Net, VB.Net
  • Windows Azure Pack / Azure Stack Development Workshops

One Comment

  1. Johnc338 June 19, 2014 at 12:10 - Reply

    I really like your writing style, fantastic information, thanks for putting up ebafdkbkebdf

Leave A Comment