Home > PowerShell automation for Windows Server 2008
Step-by-Step Guide:
EMAIL THIS

PowerShell automation for Windows Server 2008

17 Aug 2009 | SearchVirtualDesktop.com

Enterprise IT tips and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google

Windows PowerShell is quickly becoming a sought after skill set. A management platform designed by Microsoft, PowerShell allows administrators to automate tasks resulting in greater productivity and efficiency. Download, install and configure PowerShell in the following three easy steps.

Step 1: Download PowerShell

Unless you are running Windows 2008, Windows 7 or Windows 2008 R2 you will need to download PowerShell before you can get started: Download PowerShell here.

Step 2: Install

Environment Install directions
Windows 2008 PowerShell ships as a feature on Windows 2008. To install PowerShell, simply add the feature (see figure 1.)
Vista,
Windows 2003,
Windows XP
Double-click the file downloaded previously and step through the wizard. This will install PowerShell in %SYSTEMROOT%System32WindowsPowerShellv1.0 and add the appropriate shortcuts.

Installing PowerShell in Windows Server 2008
Figure 1 Installing PowerShell in Windows 2008. (Click on image for enlarged view.)

Step 3: Configure

Following a successful PowerShell installation, three basic features need to be configured to get the most bang for your buck.

Execution Policy

By default, PowerShell will not run any scripts and the file association (for .PS1) is set to notepad. These are security measures that Microsoft implemented to protect you. There are four security levels:

  1. Restricted: No scripts will run (default).
  2. AllSigned: Only digitally signed scripts by a trusted CA will run.
  3. RemoteSigned: Scripts downloaded from the Internet Zone will need to be signed. All other scripts will run.
  4. Unrestricted: All scripts will run. You will still get prompted for "Internet Zone" scripts.

For more information: get-help about_Execution_Policies

Profile

Profiles are like the autoexec.bat for PowerShell; they are used to setup the environment with customizations. There are two main locations for profiles:

  1. The global location, which affects all PowerShell sessions
  2. User specific and stored in the user's profile -- there is a default variable called $Profile that contains the path to the user's profile.ps1 file

For more information: get-help about_profile

Prompt

One of the most common uses of a profile is to create a custom prompt. Every time a command is executed, a function called prompt is called. It is possible to overwrite this function with your own version. While this is useful, be careful -- remember, it gets called every time you run a command; therefore, you need to keep it simple and quick.

For more information: get-help about_prompt

Useful Commands in PowerShell

Command Use
Get-Help This cmdlet provides help for any cmdlet. If you want to know what a cmdlet does and how to use it… this is your guy!
Get-Command This cmdlet will return a list of commands that PowerShell can use. By default it lists cmdlets and functions.
Get-PSSnapin This cmdlet will return a list of loaded snap-ins. If you want to see all snap-ins available use the -register parameter.
Get-Member This cmdlet will list all the members an object has to offer. You can use this to find out what properties and methods to use on the object returned from a cmdlet.

For free PowerShell scripts and more PowerShell information and news, I suggest checking out the following websites:

ABOUT THE AUTHOR:   
Brandon Shell
Brandon has been in the IT industry since 1994. He started out as a PC tech and general fix-it guy for numerous companies. In 2000, he joined Microsoft as contractor for the Directory Services team (the first of several times) until he became a full-time employee in 2002. In 2004, he left Microsoft to pursue a new position focusing on his real passion, PowerShell. In 2007 he joined the PowerShell MVP ranks and spent the last several years building his PowerShell knowledge and helping others build theirs.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
Application virtualization and streaming
Working with Terminal Services RemoteApp
Bank steps up application virtualization with XenApp 5 SP2
Microsoft bundles App-V with Remote Desktop Services
Midyear review: Top 10 virtual desktop tips
Getting started with application streaming and virtualization
XenApp cmdlets for Windows PowerShell
Why changing application delivery is so hard
Microsoft and Citrix join forces against VMware for VDI
Image management with app virtualization and Group Policy
Choosing the right client computing technology

Virtual desktop management
Citrix CEO: Transition to on-demand services won't be pretty
What's new with virtual desktop infrastructure?
How to protect virtual desktops on a corporate network
Symantec and Quest's desktop virtualization suites hit the big leagues
Moving from Presentation Server 4.5 to XenApp 5.0 Feature Pack 2
Top tools for securing a virtual desktop infrastructure
The top 5 ways that VDI can help improve your enterprise's security
Will Windows 7 fuel desktop virtualization adoption?
Rejoice! Citrix modifies its XenDesktop license plans
Manage Remote Desktop Services with Windows PowerShell

Tools and Technologies
Installing VMware View components
How to configure Wyse terminals without console interaction
Dazzle brightens Citrix flexibility story
VMware vs. Citrix virtual desktops -- what's the better deal?
VMware View 4: An improvement to View 3, but still a ways to go
VMware revs up performance on virtual desktops
Symantec and Quest's desktop virtualization suites hit the big leagues
Moving from Presentation Server 4.5 to XenApp 5.0 Feature Pack 2
Top tools for securing a virtual desktop infrastructure
Rejoice! Citrix modifies its XenDesktop license plans

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
continuous media  (SearchVirtualDesktop.com)
Real Time Streaming Protocol (RTSP)  (SearchVirtualDesktop.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2008 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts