PowerShell 2.0: One Cmdlet at a Time 6 Test-Connection

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Test-Connection cmdlet. What can I do with it? Send a ping to one or more computers Examples: Send a ping to Server01 Test-Connection -ComputerName Server01 If the result of a ping to Server01 is successful then copy a text file to a file share on that server If (Test-Connection -computername Server01 -quiet) {Copy-Item C:\Document.

PowerShell 2.0: One Cmdlet at a Time 5 Get-Hotfix

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Get-Hotfix cmdlet. What can I do with it? Retrieve hotfixes installed on a local or remote computer Example: Retrieve a list of hotfixes installed on Server1 which contain Security in their description. Display the Description, HotfixID and Caption properties. Get-Hotfix -description Security* -computername Server01 | Select-Object Description,HotfixID,Caption How could I have done this in PowerShell 1.

PowerShell 2.0: One Cmdlet at a Time 4 Out-GridView

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Out-GridView cmdlet. What can I do with it? View the output from a command in an interactive grid window. Any special requirements? Whilst PowerShell 2.0 itself requires .NET Framework 2.0 with Service Pack 1, this particular cmdlet requires .NET Framework 3.5 Service Pack 1. Examples: Create an interactive grid view of the list of services running on the machine.

PowerShell 2.0: One Cmdlet at a Time 3 Get-Counter

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Get-Counter cmdlet. What can I do with it? Collect real-time performance counter data directly from local or remote computers. Examples: Create a list of performance counters available to query in the Memory counter (Get-Counter -listset memory).paths Tip: To find a list of available top-level counters for which you could substitute in for memory in the above example you could type this set of commands:

PowerShell 2.0: One Cmdlet at a Time 2 Send-MailMessage

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Send-MailMessage cmdlet. What can I do with it? Send an email message using a specific SMTP server, from within a script or at the commaned line. Example: Send-MailMessage -to “Joe Bloggs [email protected]” -from “Jane Smith [email protected]” -subject “Reporting Document” -body “Here’s the document you wanted” -Attachment “C:\Report.doc” -smtpServer smtp.test.local How could I have done this in PowerShell 1.

PowerShell 2.0: One Cmdlet at a Time 1 Get-Random

This is the first of a series looking at new cmdlets available in PowerShell 2.0. We begin by looking at the Get-Random cmdlet. What can I do with it? With Get-Random you can either generate a random number, or randomly select objects from a collection. Examples: Generate a random number between 1 and 100. Get-Random -Minimum 1 -Maximum 101 Select a random object from a collection $users = ‘Rod’,‘Jane’,‘Freddy’ Get-Random $users

Extending the System Disk in Windows Server 2008

As a system administrator it is often not the latest and greatest big new features of a new operating system which you end up finding the most useful, sometimes its the small improvements which really make your life easier. I’ve been spending a lot more time with Windows Server 2008 recently (OK, I know R2 is out, but it takes time for large organisations to move away from older OS’s and applications.

PowerCLI workshop at London VMUG 24th November

I have been lucky enough to be invited to run a PowerCLI pre-show workshop before the main event of the next London VMUG on 24th November. A couple of VMUG’s back Alan Renouf ran a similar session on how to get started with PowerCLI. I thought this time I would move things one step on so the kind of topics I am likely to cover are reporting scripts and how you can make practical use of them, oneliners to get you great information and take a look at the VESI.

Guest Co-Host Appearance on the PowerScripting Podcast

When I got into PowerShell a couple of years back one of the first resources I discovered was the PowerScripting podcast, at the time just featuring Jonathan Walz (later to be joined by Hal Rottenberg). It was great to find some other people just as enthusiastic about this new technology as I was and also a really good learning tool with loads of resources for getting started. I think I caught up with about the first 20 episodes during a single month and my wife was forever asking me why I was always listening to “those two American guys again….

Active Directory PowerShell Quick Reference Guide

I regularly recommend and often refer to this document my good friend Alan Renouf put together Quick Reference Guide for PowerCLI. It is really handy guide to pin up by your desk when you need to remind yourself of a cmdlet and maybe one of the most common usages for it. I’ve been spending a lot of time recently checking out the PowerShell cmdlets for Active Directory in Windows Server 2008 R2 and they have also AD PowerShell Quick Reference Guide together.