Jump to content




Sign in to follow this  
craigster

outputting task sequence variables from a runbook



Recommended Posts

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?

Share this post


Link to post
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


×