Smart Automated Maintenance Series, Part II
August 9, 2024
Welcome to 2040: The Journey Continues! As we dive into April, it’s hard to believe how quickly the first quarter has passed. The to-do list is growing, time is ticking, and the pressure is on to complete those small, everyday tasks. But this time, you’ve got an Ace up your sleeve.
You know the saying, “You are the master of your own destiny”? Well, today, that rings true. I trust everyone has wrapped up their homework from our last session because today, we’re shifting gears toward automating those tedious, time-consuming tasks. For me, that’s handling a license replacement.
Let’s start with my process map and focus on the critical path items highlighted in red boxes.
Mapping Out the Process
As you can see from my process map, it’s a major problem if I can’t log into either web portal.
Identifying Critical Path Items
Let’s start with my process map and focus on the critical path items highlighted in red boxes. As you can see, it’s a major problem if I can’t log into either web portal.
Transitioning Between Applications
Since I have two logins to complete with two different apps, we’ll use that as a natural break point in the path to move from one application script to another. And yes, you can combine them and make the script more robust, but that will be something we will cover later.
Permissions and Synthetic Users
Taking a quick step back, we can see that for my use case, I don’t need to log into the computer as a specific user, just the web portals. Effectively, this means that I don’t have to worry too much about what permissions I grant my synthetic users other than being able to log into a system where they have access to the web portals.
Building the Application Script
The Script Editor
Finally, we get to the juicy bit. We are now ready to grab the Script Editor from the appliance and build our application script.
Writing Pseudo-Code
We will start with a bit of pseudo-code so we can remember what we are doing.
My first application script looks like this:
- Start the browser
- Browse to the License system and login
- Fill in the license information
- Generate the license
- Gather the license information
- Save information to a file
My second application script looks like this:
- Start the browser
- Browse to the Lab management system and login
- In the lab management system, browse to the license storage location
- Gather the license file
- Upload the license file
Time to get coding.
Testing and Configuring the Scripts
Whew. That was a lot of typing. You tested your scripts, right?
Creating an Application Group
Once more, into the breach! Once your scripts are uploaded to your appliance, we must create an Application Group. I like to use application groups when I have multiple scripts with intermediate steps that need to be configured the same across test types.
Application-Specific Credentials
In my case, I have one application script for generating the license and a second for uploading the license file to the training lab management system. I also highly encourage the use of the application-specific Application Username and Application Password fields. Since each of my apps uses its own credentials, this allows the engine to pull the credentials from the appliance on the fly, meaning no credentials
Creating the Application Test
Using the Desktop Connector
Next, we will need to create an application test. In this instance, we will be using the desktop connector. This is important for the automated part of this exercise. I also recommend turning off the EUX Score and Session Metrics.
Determining the Maintenance Schedule
In this use case, we don’t care about these items since we are just logging in to perform maintenance and not trying to mimic a full user workflow.
We are now at a fork in the road. Since we are on the basic step right now, we need to determine our interval for when the maintenance task needs to run. The major question for you, dear reader, is what schedule you must define.
For my use case, I need to run late at night on the last day of the month. With this in mind, I will be using an application test with the desktop connector since I can use Windows Task Scheduler to handle the execution part. If you had a task you needed to run daily, a continuous test may be more fitting.
Spoiler Alert: I will use a continuous maintenance test later. But you have to walk before you can run.
Scheduling the Maintenance Task
Running the Maintenance Task
Finally, pick a system where you want this maintenance task to run. This can be any Windows system with the software required by your application scripts and the ability to talk to the appliance. Now, simply use Windows Task Scheduler to schedule your tasks accordingly. The pseudo task I created looks like the following:
- At 11:30 PM on the last day of the month
- Run the process “C:\ProgramData\LoginPI.Logon.Exe” with the arguments of the Application test ID.
Congratulations!
Congratulations, you have now completed the basic automation of your mundane maintenance task, just in time for the end of May. I’ll see you in part 3 of our series when we discuss some things you can do to better control the scheduling and running of your scripts.
EUC Trends