Automation / SCO / SCSM Tip: Always retry when trying to update an items or any other action in external systems (how to use looping)!

In my work on automating system center service manager, I have learned my lessons!

On my blog i want to share bits of my experiences so that hopefully you do not hit the same issues in your automation.



Always retry your actions when trying to update an item in service manager

and it is always a good idea to think about retried when connecting to any system! cloud or on-prem!


Why? you might ask

In this case it is about the  dreadful service manager error message for

“The item has been changed by another user or process. Cancel your action, reopen the item and try again.”

This error happens if another user or the system has changed the item while it was open in your console/form.

but it could be any errors such as temporary network problems or similar


In any kind of automation, depending on how it is build, the item might be open for more or less time when updating.

In Orchestrator you can use the “Update Object”


This activity opens the item and changes the value.

It only use a small amount of time, so you might think that it is no problem.


but a some point you will hit the same problem because a user or a workflow tried to update the item at the exact same time!


So what do to?



In Orchestrator it is easy to do:


1. Right Click the activity and select “Looping…” (in this case i have renamed it to Update SR)


2. Enable the looping and set a delay for instance 5 seconds between the attempts


Now looping is enabled!

3. Change to the Exit Tab


By default the exit condition is “Success”.. which is great! … unless!

unless the error is a permenent error, such as servername is wrong or access denied.

Then this loop will retry for ever and ever in an infinite loop!


4. To fix this we add a condition for exiting the loop after a number of attempt.

5. Click Add

6. Click the new added condition on the “Update SR”



7. in the published data dialog check the “Show common published data” checkbox


8. Now you are able to select properties for the loop status


9. Select the “Loop: Number of Attempts”. or you could choose “Loop: Total duration” which is defined in seconds

10. Set the condition operator to Equals and the value to 10 or how many retried you want.


11. Click Finish

12. Now looping is enabled and it will retry 10 times with a delay of 5 seconds between!


By |2017-08-22T09:25:51+00:00January 15th, 2015|Automation, Service Manager (SCSM)|0 Comments

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

Leave A Comment