Skip to content

outputting task sequence variables from a runbook

Featured Replies

I managed to get this working but, as I've just started using Orchestrator, I wanted to see if a better solution could be found to a problem I encountered.

Basically, I wanted to automate the removal of PCs from SCCM and AD before they are re-imaged as currently some technicians don't have permissions to remove these objects. To this end, I came up with the idea of having a runbook which would check to see if the machine was already found in either place, this would then set TS variables which would display this information in an HTA. The user could then choose to remove or keep the machine, and this would be picked up by a second runbook which actually removed the objects.

Now, I know that the first runbook isn't strictly required. But as a learning exercise I wanted to get it working. What I found was that I had to run two scripts which queried ad & SCCM separately and return true or false and return these via one return data activity. Returning these back to the TS was the tricky bit. No matter how I did it, going by the ZTIExectuteRunbook log, it would seem that the two variables were returned more than once. So you would get the correct values returned, but also it would right them back blank. Depending on which variable was returned last would determine if the correct result was picked up by the HTA.

To me what was happening is that the two scripts were finishing at different times, which caused the return data to be activated more than once. As each script only wrote one variable at a time, the other was left blank. I ended up splitting both into two different runbooks and calling them from a parent runbook.

My question is, is there a simpler solution to this?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.