Quick and easy, with a small caveat or two… Continue reading “PowerShell: Connecting to a Virtual Machine”
Tales From IT: A Round-About Career Path
Sometimes I think back on my career path and it’s a bit…. meandering. I love what I do but how I got here was more luck than judgement. Still, in the style of Marvel’s WhatIf? there were a few key points where things could have gone in a very different direction… Continue reading “Tales From IT: A Round-About Career Path”
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: Test a File Is Locked
A nice, short function this one;
<# .SYNOPSIS Tests if a file is locked. #>
function Test-FileLocked
{
param
(
[string]$FilePath
)
try { [IO.File]::OpenWrite($FilePath).close();return $false }
catch {return $true}
}
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”
PowerShell: Synchronizing a Folder (and Sub-Folders) Part 6
Hi. Here’s another update on the Sync-Folder script here. In this part I add some more code to use literal paths (so that special characters don’t cause the sync to fail) and a report of the numbers of copies, updates, folder removals etc performed.
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 6”
PowerShell: Is an Object a Mailbox or Remote-Mailbox?
Before you start processing a bunch of Exchange objects sometimes you might want to check if they’re Mailboxes or RemoteMailboxes. The script (and explanation) is after the break. Continue reading “PowerShell: Is an Object a Mailbox or Remote-Mailbox?”
PowerShell: Check if an Email Address is Valid
There’s a pretty simple way to test if something is a valid email address but it’s nice to wrap that around with a bit of code to test for a stream or array of values.
The function and explanation follows.Here’s the full function with an explanation (and alternative way to make it work) afterwards.
Continue reading “PowerShell: Check if an Email Address is Valid”