||Windows Powershell (3) blog.crowe.co.nz.Models.Category
The book gives you a short introduction with many exercises about the interactive part of Windows PowerShell as well as some hints how to use other objects like WMI, .NET or COM objects like Excel or Internet Explorer.
A simple example to return all the fields in the IISWebService object on an IIS 6 computer using Windows PowerShell and the get-wmiobject cmdlet.
A simple example to return just the name fields from the IISWebServer object on an IIS 6 computer.
Windows PowerShell is a new command-line shell and task-based scripting technology that provides comprehensive control and automation of system administration tasks.
Windows PowerShell allows Windows administrators to be more productive by providing numerous system administration utilities, consistent syntax, and improved navigation of common management data such as the registry or Windows Management Instrumentation (WMI).
Windows PowerShell also includes a scripting language which enables comprehensive automation of Windows system administration tasks. The Windows PowerShell language is intuitive and supports existing scripting investments. Exchange Server 2007 and System Center Operations Manager 2007 will be built on Windows PowerShell.
Windows Powershell has also been known under the code name Monad and is currently in Release Candiate.
Mondad is built on top of the .NET Framework version 2 and basically allows you to create scripts called cmdlets that you register with the system and then can reuse at any time.
A cmdlet is referred to by a verb and noun pair, separated by a "-":
These cmdlets can be piped together using the pipe character (same as the old DOS pipe command) | But unlike the simple DOS pipe command you can concatinate any monad cmdlets to product interesting and very powerful results.
For the download url go to http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx
The download is 2.2 MB for RC1 and requires that you register prior to downloading.
side note: I had problems with the Microsoft Passport logging into this site so I logged into another Microsoft Passport site and then went back to the Powershell registration url and it worked fine.
An example to find all services that are stopped on your machine
Now this may be very nice but how about something complex such as doing a DIR on the registry from within your script?
What about using IPConfig.exe a standard console application to display an IP Address?
Typing IPCONFIG into the Powershell returns the standard data you woud expect (something like this)
Using a Powershell filter you can get the IP Address very simply by itself without the other details.
This is just touching the surface of this powerful tool. You can create functions with looping, variables, regular expressions and so much more..
A good site that has quite a few scripts is at http://www.reskit.net/monad/samplescripts.htm and also the Microsoft Script Center web site has a category for Powershell Scripts at http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
Remember to download go to http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx