IT Administrators’ Top PowerShell Commands

What is PowerShell and how is it being used to its best advantages by IT administrators?

A Windows shell, or user interface, developed by Microsoft, PowerShell allows users to automate tasks. It is also commonly used for configuration management. As an open source project, it can also be used on Mac and Linux operating systems. The main goal of using PowerShell for an IT administrator is to make life easier through automating repetitive and tedious tasks.

There are many, many things this interface can do, but typically IT managers can find value in these top commands. A lightweight PowerShell script which performs a single function (i.e., a single command) is known as a cmdlet  (pronounced “command-let”) Here, we outline some of the top cmdlets that are beneficial to IT administrators.

Enter-PSSession

This is the cmdlet you need to start a PowerShell session remotely. As an IT administrator, this is a very useful command as you do not have to physically attend at the subject computer but can manage it from your own desktop.

Get-Command

This is one of the most basic cmdlets, very helpful for reference as IT administrators delve into the PowerShell interface. By typing in ‘get-command’ users receive output that shows all of the commands available to them within that session. If you are stuck for what to do next or just need a reminder of the commands you can use, start here.

Get-Help

This cmdlet does what it says — by typing in ‘get-help’ users get information to help work available commands. Like Get-Command, Get-Help is basic but very valuable. You can use ‘get-help get-command -examples’ to see examples from help files which explain what each cmdlet and its parameters do when they are invoked.

Get-Process

‘Get-Process’ will allow IT administrators to quickly gain access to a list of every process running at the time. From there, users can use ‘Stop-Process’ to stop anything that is frozen, unresponsive, or otherwise unwanted. If things seem like they are not quite working as they should, these two commands together will identify and halt the problem.

Set-ExecutionPolicy

Microsoft disables scripting by default to prevent the execution of unwanted, malicious code. With this cmdlet administrators are able to override this and command the level of security around scripts, from restricted access to all signed (scripts can run if signed by a trusted publisher), to remote signed (scripts can run if they are locally created and remote scripts need to be signed by a trusted publisher), to unrestricted.

If you are administrating a system that you do not know well, one of the first things you can do to orient yourself is to run a similar cmdlet, ‘Get-ExecutionPolicy’ to find out what restrictions are in place before you start trying to run scripts without the proper permissions in place.

Checkpoint-Computer

This cmdlet is essentially a save point for IT administrators who need an extra level of backup. If you are running anything risky or making big changes, ‘Checkpoint-Computer’ saves your system as it is in that moment, so you can always go back and restore everything to where it was. Be forewarned that this cmdlet can only be used once every 24 hours, so use it wisely.

Invoke-TroubleshootingPack

Do not despair if you run into a system problem (especially if you have set a checkpoint ahead of time). This cmdlet, in conjunction with a troubleshooting pack script, allows administrators to easily start the script to diagnose and repair common issues.

Restart-Computer

Another useful command for remote work, this, and ‘Stop-Computer’ allow the IT administrator to remotely restart or shut down computers and servers as required.

Unlock-ADAccount

This cmdlet unlocks active directory accounts. If a user has locked themselves out of an account or been suspended for exceeding maximum password attempts, you as an IT administrator can bring back access with this simple command. ‘Set-ADAccountPassword’ enables administrators to manually set a password for an active directory account or computer.

ConvertTo-HTML

Not everyone is on the level of an IT administrator, tech-wise, and this PowerShell command helps bridge that gap. ‘ConvertTo-HTML’ allows users to turn information into an HTML file, which can then be passed along to other people in a more user-friendly manner. ‘Export-CSV’ is a similar cmdlet, creating data that can be opened in Microsoft Excel.

Get-USB

This cmdlet is simple but powerful, displaying all the connected USB devices in a specified system or computer. It’s important to know what is being plugged into each device, and this cmdlet gives you that information.

GroupLink is here to help you navigate your systems and how they can be improved and integrated with our own technology offerings, such as PowerShare™. To learn more about what we do and how we can assist your organization in meeting your own goals, please contact us today.

Related Posts