PowerShell tutorial for Windows server admins

A lot has changed with PowerShell 4.0. Whether you're new to the CLI or want new tricks in your server administrating bag, now's the time to bone up.

Windows server administrators are catching up with the newest version of PowerShell: 4.0.

Microsoft Windows PowerShell 4.0, the latest version of the scripting language, is found in Windows Server 2012 R2 and backward-compatible with earlier PowerShell versions.

We've compiled a PowerShell tutorial for Windows server admins who are just starting out with the scripting language, learning about version 4.0, or looking for tips and tricks.

Important changes in PowerShell 4.0

Don't want to manually intervene with the servers that often? PowerShell 4.0 introduces parameters for more automated, easily executed jobs.

Version 4.0 focuses on automating administration, with features such as Desired State Configuration, which applies the same roles and settings to multiple nodes, and offers easier signed-script execution for server admins.

One feature that continues to create confusion in version 4.0 is the PowerShell workflow, a PowerShell feature that plays by Windows Workflow Foundation rules. Workflow lets admins run multiple tasks concurrently in the script code, but it excludes certain PowerShell features. If you take the time to learn its requirements, PowerShell workflow pays you back with automation and flexibility.

Benefits of PowerShell scripting

PowerShell scripting is an entirely new language for server admins who are comfortable in a graphical user interface. You don't have to go it alone.

Start by working with an experienced admin's scripts. Generic-purpose scripts will help you adapt the structure and language for your own tasks. Study examples of the script in use.

While learning about PowerShell scripting from your peers, familiarize yourself with these universal tips for server administration from the PowerShell interface. Learn how to search for all available commands and refine your list to the ones that you need for a given task. Think about ease of maintenance and error handling when you write scripts. And enjoy the satisfaction when you figure out a script that accomplishes the task at hand in half as many steps as your first attempt.

Once you work in PowerShell and develop skills, take a look at these dozen pointers, tricks and tips. Depending on your scripting level, you might already know how to parse XML, but what about snapping in your VMware vSphere commands? Perhaps you're used to PowerShell Web Access but you've never enabled PowerShell remoting until now. Scan the list and find an area where you can enhance your repertoire.

Alright, you're a PowerShell expert now. Time to have a little fun with PowerShell pranks.

That's my specialty

Until recently, GUI was the name of the game for Exchange Server admins. PowerShell cmdlets and scripts are the future of Exchange management, and important changes in Exchange 2013 have even PowerShell-confident administrators learning new techniques to get the most out of the interface.

For the virtualization crowd, PowerShell automates virtual machine configuration, management and other tasks. The good news is that the virtualization community shares full-fledged scripts and workflows, such as a way to shut down guest VMs in Hyper-V, or how to export a VM and more. Before you spend all afternoon writing scripts for your virtual environment, check out shared resources from other PowerShell-powered virtualization admins.

For the storage team, PowerShell went from useful to essential with the advent of Windows Server 2012. Get informed on some of the storage management basics on PowerShell as a starting point for fully managing Windows Storage Spaces from the command line interface. For example, learning which cmdlets to use to view the disks vs. the physical disks vs. the available physical disks of a server's storage will help admins create storage pools for the data center.

This was last published in May 2014

Dig Deeper on Virtualization and private cloud

PRO+

Content

Find more PRO+ content and other member only offers, here.

Join the conversation

4 comments

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

What's the most difficult part about using PowerShell?
Cancel
Powershell was apparently written with the intent of preventing "regular people" from doing anything with a windows based computing. The writer used the basic scheme for keeping it as cryptic as possible: 1) Never explain an abbreviation, 2)
Always assume that the reader already knows it all, 3) Never explain a concept within a given context, 4) Never give useful examples, and 5) always stay utterly abstract.
Great program, that powershell, but only if you are a genius with regard to software, logic, mathematical and cryptological envisioning.
Cancel
In short, "I am from Microsoft, and I am here to help you" has taken on the untruthful y meaning generally applied to "I am from the government, and I here to help you".
Cancel
Figuring how to use  it creating a remote connection using 1.0 and 2,0  running scripts against another machine too
Cancel

-ADS BY GOOGLE

SearchWindowsServer

SearchEnterpriseLinux

SearchServerVirtualization

SearchCloudComputing

Close