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: Get Largest Mailboxes on an Exchange Server (One-Line Command)

Hi.  Last week a customer asked me find out which mailboxes had eaten all the pies on a particular Exchange server;  getting a list of the largest mailboxes and whether they were in a disconnected state (already  removed and waiting purge).

To get an accurate picture I needed to take into account the deleted items in the mailbox as well.  It’s a small command but it’s got a few squirrelly bits I’ll go into as well after the line. Continue reading “PowerShell: Get Largest Mailboxes on an Exchange Server (One-Line Command)”

PowerShell: Setting Exchange Send-As Permissions without Using the Add-ADPermission cmdlet

The Send-As permission for objects in Exchange is set on the AD object (rather than the mailbox itself). Normally, the weapon of choice is the Add-ADPermission cmdlet but interestingly that cmdlet is only available if you have some serious Exchange permissions; Organization Management. What you’re doing though requires fairly low-level AD permissions; you’re just modifying some attributes on an object. So I did some investigation and came up with a function to set Send-As permissions without using Add-ADPermission. Continue reading “PowerShell: Setting Exchange Send-As Permissions without Using the Add-ADPermission cmdlet”