Guy recommends :
Free Solarwinds
VM Console

Solarwinds VM Console Free Download

Find out which of your VMs are a waste of space and which VMs need more resources.



Download PowerShell - Microsoft's New Command Shell

Get your Copy of PowerShell

One of my themes with Windows PowerShell is that nothing is too simple.  Therefore, let me start by checking that you have downloaded and installed the correct PowerShell files.  If indeed, you have PowerShell installed and functioning correctly then go to my 'Execute Commands' page.

PowerShell Downloads

It breaks my heart to send you away from my site, but it is essential that you get a copy of PowerShell and .NET Framework from Microsoft's own site.

PowerShell itself
Key point, you need to download an operating specific version of PowerShell:

  • Vista
  • Windows Server 2003
  • XP
  • For Server 2008, there is an easier technique: install PowerShell by launching the 'Add a Feature' option in Server Manager.
  • In Windows 7 PowerShell is installed by default.

Download PowerShell from Microsoft's site

.NET Framework
PowerShell is an object based scripting language, consequently, it needs .NET Framework for the definitions of the Windows objects.  PowerShell works fine with either .Net Framework v 2.0, or v 3.0.

Microsoft .NET Framework 2.0 Redistributable Package (x86)

Microsoft .NET Framework 3.0 Redistributable Package

PowerShell Installation

Here are the three stages before you get up and running with PowerShell:

  1. Obtain, then install .Net Framework 2.0
  2. Get a copy of PowerShell, for example v1.0  (2.0 in 2008)
  3. Start, Run, PowerShell.  PowerShell $Host command

Once you have installed PowerShell (and .Net), try this simple command:
$Host

Here opposite is a screen shot of what you should see: Version 1.x.x.x

As usual, there are two ways of doing everything, you could try. 
Get-Host

Guy Recommends:  Solarwinds' Free Bulk Import ToolFree Download of Solarwinds  Bulk Import Tool

Import users from a spreadsheet.  Just provide a list of the users with their fields in the top row, and save as .csv file.  Then launch this FREE utility and match your fields with AD's attributes, click to import the users.  Optionally, you can provide the name of the OU where the new accounts will be born.

There are also two bonus tools in this free download, and all 3 have been approved by Microsoft:

  1. Bulk-import new users into Active Directory.
  2. Seek and zap unwanted user accounts.
  3. Find inactive computers.

Download your FREE bulk import tool.

The Situation with PowerShell and the Operating System

Previous scripting programs came 'built-in' to the operating system.  DOS has its cmd.exe, while VBScript has cscript.exe as its scripting engine.  As of 2007, no commercial operating system, not even Vista, has PowerShell 'built-in'.  Fortunately, installation is one of Microsoft's strengths, thus obtaining both PowerShell and .Net Framework is an uncomplicated one-off task.

PowerShell Runs on these systems: Windows Server 2003, Windows XP and even Windows Vista, however each has their own version of PowerShell.

Getting Started - PowerShell's Structure

The basic PowerShell command consists of a two-word sentence.  Start with a verb follow with a dash and end with a noun.  Naturally, you press carriage return when you have finished the command.

Get-Process (Correct).

get -  process (Wrong. The dash needs no space).

With time and practice, you will soon increase your vocabulary.  Experiment with nouns such as Eventlog.  For example:
Get-Eventlog -list. 

From this example we learn that the dash or minus sign has another role, namely as a modifier or switch, thus the role of a space, or a lack of a space, becomes more obvious, for example -list tells the command to display all the event logs.

Perhaps the most useful command for beginners is: Get-help followed by the command.  For example:

Get-help process
or
Get-help Get-Process
or better:
Get-help Get-Process -full

Alternatively, you could try plain: help.  From this we deduce that the default verb is 'get'.  Test this theory by typing just a noun that PowerShell understands:

Process
help
eventlog

If you like this page then please share it with your friends

 


See more Microsoft PowerShell tutorials

PowerShell Tutorials  • Methods  • Cmdlets  • PS Snapin  • Profile.ps1  • Exchange 2007

Command & Expression Mode  • PowerShell pipeline (|)  • PowerShell 'where'  • PowerShell 'Sort'

If you see an error of any kind, do let me know.  Please report any factual mistakes, grammatical errors or broken links, I will be happy to not only to correct the fault, but also to give you credit.

 *


Custom Search

Guy Recommends: WMI Monitor and It's Free!Solarwinds WMI Monitor

Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems.

Fortunately, Solarwinds have created the Free WMI Monitor so that you can actually see and understand these gems of performance information.  Take the guess work out of which WMI counters to use for applications like Microsoft Active Directory, SQL or Exchange Server.

Download your free copy of WMI Monitor

 

Home Copyright © 1999-2012 Computer Performance LTD All rights reserved

Please report a broken link, or an error.