Output Exchange 2007 Retry/Ready Messages

Here’s a quick and dirty Exchange 2007 command-let that will output all the outgoing emails that are not being delivered. It Checks the message status (NOT “Active) and the message retry count (GT 0) and outputs the results. Get-Message -Server SERVER01 -IncludeRecipientInfo | Where{$_.RetryCount -gt 0} | Where{$_.Status -ne “Active”} | SELECT FromAddress, Recipients, LastError [...]

Tags: , , ,

Filed under:Uncategorized

Auto Email when StorageGroupCopy Status Failed

Man! I’m killing these powershell scripts today – and they’ve all been related to alerting/reporting via email. If you’ve missed my two other posts – there is a mailbox size report (http://mattlog.net/2009/03/12/auto-email-exchange-2007-mailbox-report/) and a StorageGroupCopyStatus report (http://mattlog.net/2009/03/12/auto-email-exchange-2007-storagegroupcopystatus/) This one is a little more useful. Basically, this PowerShell script checks the SummaryCopyStatus and checks that it’s [...]

Tags: , , ,

Filed under:Uncategorized

Auto Email Exchange 2007 StorageGroupCopyStatus

Exchange 2007′s Storage Group Copy feature is one of my favourites, however the one area it is really lacking is the reporting. You need to manually run the Get-StorageGroupCopyStatus -Server INITIALSERVER -StandbyMachine TARGETSERVER to find that your SCR is Healthy. I’ve been playing around writing some simple PowerShell scripts today so I thought I would [...]

Tags: , , , ,

Filed under:Uncategorized

Auto Email Exchange 2007 Mailbox Report

Hi all. I’ve written this simple PowerShell script to output your user mailboxes, their total size and the item count – the script will then email the output to a specified account in a pretty HTML table format. Feel free to download the .ps1 file and run it as you wish. Remember that you need [...]

Tags: , , , ,

Filed under:Uncategorized

PowerShell: Remove Files based on date

I’ve had the need to remove a bunch of differential backup images from my backup server for a short while now – and thought this was the perfect opportunity to crack into powershell. I’m going to post the script and run through the important parts: dir C:\BACKUP -recurse -exclude SERVER1,SERVER2,SERVER3,SERVER4,SERVER1.IMG,SERVER2.IMG,SERVER3.IMG,SERVER4.IMG,FileClean.PS1 | where { ((get-date)-$_.creationTime).days -ge [...]

Tags: , ,

Filed under:Uncategorized

Handy Download: PowerShell Default Alias List

Here’s a handy file for remembering all of the default PowerShell Alias commands. These save so much time when working in the shell. Print it out and tape to your cubicle for easy access! powershellalias

Tags: ,

Filed under:Uncategorized

Opening Windows Powershell

Quick tip: You don’t need to browse to Start > Programs > Windows PowerShell 1.0 > PowerShell to launch a new PowerShell cmdlet – just open a Run box and type “powershell” Also, by default in Server 2008 the PowerShell console is coloured blue. This is for a good reason – it stops you from [...]

Tags:

Filed under:Uncategorized