PowerShell: A Simple Batch Processing System, Part 1

batchHi.  I’ve written a few scripts that have gotten to be quite large.  In all cases they’ve needed to make a series of changes to a set of objects and log the results.  It’s normally important that some of the later changes only get made if the earlier ones are successful;  for example only changing the default SMTP address on a mailbox if another SMTP address was added earlier.

This series of posts will go into a decent system I’ve found for accomplishing this with some skeleton examples that are (hopefully!) easy to adapt. Continue reading “PowerShell: A Simple Batch Processing System, Part 1”

PowerShell: A Simple Batch Processing System

This is the skeleton of a Batch Processing System (Importing from a CSV file, performing consecutive tasks that are dependant on the previous task completing and then outputting the result).

I detailed how it works in Part 1 here and in Part 2 here. Continue reading “PowerShell: A Simple Batch Processing System”

PowerShell: Synchronizing a Folder (and Sub-Folders) Part 8

This update corrects an issue where parts of the configuration XML are missing;  what if you don’t want Exceptions or Filters? Continue reading “PowerShell: Synchronizing a Folder (and Sub-Folders) Part 8”

PowerShell: Why the Count Property or += Don’t Work Sometimes

One thing that I occasionally forget (and it can take me a while to remember the fix) is some apparently strange behaviour when processing an array.  Sometimes array-based methods don’t work when there’s only one item (or no items!) to be processed.

It’s all down to PowerShell’s automatic type conversion and is pretty easy to fix. Continue reading “PowerShell: Why the Count Property or += Don’t Work Sometimes”

PowerShell: Synchronizing a Folder (and Sub-Folders) Part 7

Hi. Here’s another update on the Sync-Folder script.  In this update Strict mode goes on, I make sure the statistics reset between runs, the Statistics output is rewritten and I add the option to only sync items that match a $Filter.

Update : I’ve revisited this script a few times with new additions and modifications.The latest full version of the script is here.  That post also includes links covering the other revisions to the script. Continue reading “PowerShell: Synchronizing a Folder (and Sub-Folders) Part 7”

PowerShell: Create a CSV Report of Mailbox Sizes

The following is a simple script to generate a mailbox size report CSV for a set of email addresses.  The full function and explanation follows.

Continue reading “PowerShell: Create a CSV Report of Mailbox Sizes”