Walk through 5 common PowerShell uses for IT ops teams
PowerShell use cases have expanded past Microsoft's original design -- but IT automation is still at the tool's core, whether it's to support an AIOps strategy or monitor server performance.
PowerShell enables admins to perform a wide range of IT operations and automation tasks. So where should they begin?
Here are five recent SearchITOperations articles that break down PowerShell uses -- some common, and some emerging -- IT teams can explore today.
1. Search the Windows event log
The Windows OS stores event logs -- or lists of system, security and application notifications -- which are crucial for IT admins to be able to diagnose problems and predict others. However, for IT teams to use this data, they must be able to parse through it.
DevOps and PowerShell engineer Anthony Howell discusses how PowerShell serves as an alternative to other methods -- such as the Event Viewer monitoring tool -- to perform an efficient Windows event log search. Steps include the use of the Get_WinEvent cmdlet and performing a query for a specific provider, meaning the entity that creates a log.
2. Manage ACL folder permissions
IT automation is quickly becoming a standard across enterprises, as admins look to reduce manual workloads and increase productivity. It's no surprise, then, that one common use for PowerShell is to automate a common, yet tedious, IT task: the management of access control list folder permissions.
While the process to set an ACL is fairly simple, it is also terribly repetitive. Howell walks through how to use PowerShell to write a script that manages ACL permissions. The process includes issuing commands to retrieve existing ACL permissions, creating an ACL folder permissions entry and adding a rule to the ACL folder.
3. Track key monitoring metrics
A core task for IT admins is to monitor server performance. While enterprises can opt for third-party tools, those familiar with PowerShell can use the scripting language to track key performance metrics.
In this tutorial, IT expert Adam Bertram first explains how to choose and define the PowerShell performance counters -- or metrics -- to monitor; these include idle time and disk queue length. Then, Bertram walks through how to find the values of those performance counters at a certain time -- known as counter samples -- and offers guidance to create an HTML report, like the one shown below, to display that information.
4. Support an AIOps Strategy
Traditional IT troubleshooting methods can fall short, given the high data volumes in enterprises today. An AIOps strategy aims to combat that challenge -- and PowerShell can play a role. Systems engineer Dan Franciscus walks through three ways an IT team can incorporate PowerShell into an AIOps initiative.
First, admins can use PowerShell to perform a key step in any AI-driven IT strategy: data gathering. For example, the automation tool can collect Windows event data and dump that information into a CSV file. PowerShell can also convert data types, such as CSV files, REST APIs or SQL, into a common framework for simplified analysis. Finally, PowerShell remoting can aid issue remediation in AIOps strategies.
5. Control the Windows PATH environment variable
IT admins must manage the Windows PATH environment variable -- which stores executables for applications -- as it is essential for system and utility installations. This is another common use for PowerShell in IT operations, and it involves manipulation of the PATH variable string.
With direction from Howell, learn how to interact with the PATH environment variable via PowerShell. Specifically, see how to access the variable, split the string, return a string array of path values, add to the PATH environment variable and remove a path.