PowerShell: Taking Control of CTRL-C.

Have you ever been in the middle of running a PowerShell script and hit CTRL-C to stop it, and realize you just lost the tracking of all work performed and/or information gathered up to that point? It’s even worse when you are using PowerShell jobs for multi-threading processing, or remote computer sessions, because you potentially…


Exchange: Lingering/Orphaned In-Place Holds on mailboxes blocking cleanup/moves.

This blog post covers two different scenarios when an In-Place Hold is removed off an eDiscovery Mailbox Search, but that corresponding entry is not cleaned up properly on the mailboxes formerly targeted by that Mailbox Search. When this happens, you can’t remove the Mailbox Search and you also can’t migrate mailboxes back to older versions…


Confirming/Validating PowerShell Get-Credential Input Before Use

Have you ever used Get-Credential to generate credentials in PowerShell, only to find out when you go to use those credentials that they were invalid? It’s even worse when you are doing this in a script where the script throws errors every time the invalid credentials are used, and you have to restart the script…

8

Tracking and Controlling PowerShell Script Execution Progress via XML

Have you ever wanted to track the progress of one of your multi-step/stage PowerShell scripts on a computer, just in case during the middle of the steps the script (or PowerShell itself) terminates unexpectedly, or something randomly reboots the computer? How about if the script is supposed to reboot the computer running it at various…

6

PowerShell code to wait for a background process to finish before continuing on with a script

While this code was originally developed for an Exchange script, you can use it for any PowerShell script where you want to make sure some background process/service is finished before proceeding on with the rest of your script. I recently ran into a problem where a PowerShell scripted install/upgrade of Exchange 2016 server where the…

8