Script Based Actions was mentioned in my ControlUp 3.0 overview blog as one of the new major additions in ControlUp 3.0, this blog post will provide an in depth coverage on the new SBA feature.
SBA’s allows ControlUp admins to extend the built-in management actions library by importing PowerShell, VB or batch scripts into the console. This powerful feature enables admins to quickly select the relevant targets, execute the script and monitor the execution status via the script results screen. In addition to creating your own actions, the community SBA library offers a wide selection of existing SBA’s that were uploaded by ControlUp community members and the Smart-X expert team.
In this example we will create a new SBA called “Create XenApp Published Desktop”, this SBA will allow us to quickly create a Published Desktop for new XenApp 6.5 servers in our farm. This example will utilize some of the advanced SBA features like security context and script arguments.
Assigned to – this is the type of ControlUp object that the SBA will act upon. The possible options include Computer, Session, Process or Advanced. This SBA will create a published desktop for each XenApp server so I choose the Computer object only. The Advanced option permits your action to be invoked from multiple contexts (consider a computer action that can be invoked when selecting an entire folder of computers).
Execution Context – this is where the script is actually executed. The possible options include Target Computer, ControlUp Console or Other Computer. In my case, I want to run the PowerShell code on each selected XenApp server so I choose the ‘Target Computer’ context. The “Other Computer” option allows you to select an executing computer when you run the SBA. This option accommodates advanced scenarios, such as when the script won’t run without a specific software package which does not exist on your target computers (like the XenDesktop PowerShell modules).
Security Context – this option configures the user account that will be used to execute the SBA script. You can choose the agent Local System account (assuming the execution context is not the ControlUp console) or prompt for AD account credentials during runtime. I need to run the PowerShell code with Citrix XenApp admin credentials so I choose the ‘Prompt upon execution’ option.
$appname = $args[0]+" Desktop"
For this specific script I choose the ‘Name’ attribute which is actually the managed ControlUp computer name as it appears in the Computers view. We can choose any computer attribute that appears in ControlUp’s information grid, which allows us to pass real-time data as arguments to the SBA during runtime.
A draft is seen and can be executed only by the ControlUp user who created it.
A draft can only be executed on a single target at a time.
The draft mode is designed for testing and validating your newly created SBA. Once you are certain the script works as expected, you can click on Finalize in order to expose the SBA to all ControlUp admins in your organization and allow execution on multiple computers.
We already have more than 20 community actions including cool ones like ‘IE: URLs” which will list the URLs associated with a specific IE process (excellent for figuring out which site is causing performance issues) and useful ones like ‘Change XenApp Logon Mode’ or ‘Enable XenDesktop Maintenance Mode’.
Once the community action is installed it will appear in the Organizational Actions tab and cab be executed by any authorized ControlUp admin. You can use the ControlUp Security Policy feature to delegate specific SBAs based on AD groups and users.
For additional reading and more details on the various SBA options, please refer to the SBA online documentation. A full list of Community SBAs can be found here.
I hope you appreciate the limitless possibilities the new Script Based Actions feature has enabled for ControlUp. We will keep adding new community SBAs based on customer feedback and we plan to post specific blogs on some of them so stay tuned.
