Script of the Month – April 2020

We all know that it’s getting harder and harder to tell what day—or even what month!—it is anymore, but we checked, and it’s time for ControlUp’s Script of the Month (and there was much rejoicing).

Did you know? ControlUp welcomes script submissions from members of our user community! It’s true. We love to see what our users have created and the problems they’ve solved using ControlUp, so if you have a great one, let us know; we would love to see it. If we review your script and want to add it to our official library, one of our experts will contact you (be sure to check your inbox), so we can make your script as robust and readable as possible.

This month’s submission—the AD User and Manager Details script—comes from Rory Monaghan—a Citrix CTA, Microsoft MVP, and VMware EUC Champion—and is told in his own words. Many thanks to Rory for a great and useful script and for telling us its story.

What problem were you trying to solve?

I have a whole bunch of scripts in my environment, not all of which are published to the ControlUp community. I have used scripts to do some simple real-time app deployments to our Citrix VDAs to buy us time to update in our vDisks.

One of the scripts I did submit to the community is a simple query you can run against any of your user sessions. It returns some useful information from the user’s Active Directory profile including Name, Company, Title, Office, Office Phone Number, Mobile Phone Number, and E-mail Address. This can be useful if you notice a user is having poor performance or some sort of issue and you want to contact them. You can instantly get their contact info right from the script.

It’s also incredibly useful in a healthcare setting, since many users don’t have a dedicated phone number because they roam about a hospital campus, moving from room to room, and don’t access their email regularly. You can get their manager’s contact information and see the user’s assigned location. All of these results depend on Active Directory being populated correctly and the AD PowerShell module being loaded.

How long did you put up with this problem before writing the script?

For the contact info, I didn’t even really think it was a problem until I had ControlUp in my environment and realized how dumb it was to try to find this info from ServiceNow and Active Directory manually.

How were end users affected?

CPU and memory use was higher on machines due to more users than usual piling onto them before I ran the script to allow the other 24 servers to accept connections again.

What was the problem costing you? What was the problem costing your company?

We are measured pretty strictly on application performance and end-user experience. I can’t quantify the problem in dollars, but based on the sensitivity of the environment (my users are providing patient care in a hospital setting, so it could literally be life-and-death) it is extremely important to keep things performing optimally.

What was the final straw?

It was my own personal final straw. We have a locked-down environment, so running remote PowerShell scripts from workstations does not work, and getting onto servers capable of running remote scripts requires jumping through some hoops. Putting it in ControlUp saves me from that pain and saves my time!

How long did it take for you to write the script?

The script took about an hour.

What was the most challenging part of writing the script?

It was a little challenging as I lined it up with the data that was available in my environment but it wasn’t too bad.

What have you saved as a result of implementing the script?

I have saved myself time, manual effort, and stress (these days, there’s nothing more important than that).

What did you learn during the process?

I learned how valuable the arguments in the scripts are and have started to work on some others, leveraging data pulled from ControlUp, like the ability to check VDA uptime, how many user sessions are on it, and whether it’s in Maintenance Mode or not. If the uptime is greater than 8 days and the VDA is in Maintenance Mode with Zero Sessions, reboot and then take out of Maintenance Mode as clearly someone took that server out of rotation and forgot to put it back in.

Thanks to Rory for a great addition to the ControlUp Script Library and for being an amazing member of our user community. And remember: sharing is caring! If you have a script that’s saving you time, money, stress (or all three), let us know.

About the author

Trentent Tye

Trentent Tye, a Tech Person of Interest, is based out of Canada and its many, many feet of snow. FUN FACT: Trentent came to ControlUp because, as a former customer, the product impacted his life in so many positive ways—from reducing stress, time to remediation, increased job satisfaction, and more—he had to be our evangelist. Now an integral part of ControlUp’s Product Marketing Team, he educates our customers, pours his heart and soul into the product, and generally makes ControlUp a better place. Trentent recently moved to be closer to family. He does not recommend moving during a pandemic.