In today’s RCT Builder demo we’re creating a tool to move a device into a collection and automate the update/application of the associated machine policies. For this tool, I want to be able to select the collection and let SCCM take care of the rest. Be sure to watch the video below for a complete run-through.
Step 1: Action Properties
The action properties for this tool are pretty straightforward. Tabbed results are an appropriate choice, no need for a prompt, and we want to display the Computer Name. For inputs: select Name and Resource ID (if you’re not running Recast Server, also add Site Code and SMS Provider as well)
We need to be able to choose a collection to move the device to, so we’ll set up a custom input parameter—in this case a List:
As usual, our Display Name is what we’ll see when we run this tool, and our Variable Name is what we’ll use when mapping the correct parameter for this action later. This should be a required choice.
For our list, we will use the Constant Values of the Collections we want to be able to choose from. Be sure to separate the name of the collection and the Collection ID with Tab.
Step 2: Organize Right-Click Actions
For this tool, we need to have SCCM complete several steps. From the start node, drag over the following actions:
- Add Device Resource ID to Collection (under ConfigMgr Server)
- This will let us choose the collection to drop our device into.
- Machine Policy Retrieval and Evaluation Cycle (under ConfigMgr Client)
- This has the device complete an immediate Machine Policy Retrieval, setting us up to have the machine install the apps associated with its new collection.
- Run PowerShell Script Block PSRemoting (under PowerShell)
- We need to give our device time to complete the Machine Policy cycle, so we’ll add in some wait time before the next action kicks off.
- Application Deployment Evaluation Cycle (under ConfigMgr Client)
- This is the step we’ve been working towards. The device will update/install the app(s) according to the collection policy.
- Deployed Applications (under ConfigMgr Client)
- This will list the applications deployed to the machine, so we can verify successful deployment.
Direct the flow of actions according to the picture below:
Step 3: Map Parameters
Our last step before deploying this tool is to map the parameters for each step. All the actions in this tool can be mapped to the Start Node, as it is the computer we click on that we want to execute against.
- Add Device Resource ID:
For this action, we map the Site Server, Site Code, Resource ID from the Start Node to their respective, matching Parameters and the Collection ID from Start Node to Collection (the Custom Input Parameter from earlier).
- Machine Policy Cycle:
This action just needs the Computer Name mapped from the Start Node to the Name.
- Run PowerShell:
This action just needs us to copy our PS script, which in this case is very simple:
- The last two actions (App Deployment Evaluation Cycle and Deployed Applications) both have the same requirement—Computer Name needs to be mapped from Start Node to Name.
And we’re done! Now we can save our tool and share it with Role-Based Administration using the Recast Server.
Don’t forget, if you don’t have RCT Enterprise, you can request a free trial at anytime. If you have an idea for another tool you would like to see in RCT Builder, tweet them to @RightClickTools or email us.
Additional RCT Builder Demos:
Disable Account Tool – read more