This week, while contributing code to a collaborative project, I wanted to up my game. A lot of my tools over the years have used parameters and validation, but one of the more elusive things is creating parameters that have parameter validation criteria set at run-time. … [ Continue reading ]
Testing a variable with the value of zero
Tonight, while working on my previous script, I ran into an interesting problem when testing the presence of a value.
Consider this:
PS C:\> [int]$IntValue0 = 0
PS C:\> [int]$IntValue1 = 1
PS C:\> [string]$StringValue0 = "0"
PS C:\> [string]$StringValue1 = "1"
PS C:\> $IntValue0
0
PS C:\> $IntValue1
1
PS C:\> If ($IntValue0) { "exists" }
PS C:\> If ($IntValue1) { "exists" }
exists
PS C:\> if ($StringValue0) { "exists" }
exists
PS C:\> if ($StringValue1) { "exists" }
exists
PS C:\> if ($IntValue0 -eq $null) { "null" }
PS C:\> if ($IntValue0 -lt 1) {"less than 1" }
less than 1
PS C:\> $IntValue0.GetType()… [ Continue reading ] PowerShell Null Routing Function
This week, while troubleshooting a networking problem for a customer, I wanted to limit or block network connectivity to some remote endpoints from a test workstation. To accomplish this, I created a quick PowerShell function to null route the traffic (send it to an invalid/null next hop).… [ Continue reading ]
Update: Dynamics 365 Testing Tool
Earlier today, I was notified that the Dynamics 365 network URLs page was updated, so I updated my Dynamics test tool.
But then, I thought, what else could I put in it?
Never one to leave well enough alone, I started tinkering. … [ Continue reading ]
Update: Create-LabUsers Tool
Just when you thought it couldn’t get more awesome.
It has.
By popular request, I have added a few new features (and fixed an annoyance). First, the bug fix:
-Count 1
Yes, it’s true. If you ran the Create-LabUsers script with -Count 1 with the -InflateMailboxes parameter, you’d run into an issue because of how I calculated the $MaxRecipients value. … [ Continue reading ]
How to find Stale(ish) Azure B2B Guest Accounts
If you are utilizing external, guest, or B2B users in your Office 365 or Azure environments, you may need a way to determine which objects haven’t been logged in or used in a while. Azure AD doesn’t provide an easy way to view this information (really only having the refresh token time available). … [ Continue reading ]
Mail-enabling Guest Users or “How I made everyone show up in the Address Book”
So, today, I received an email from one of my esteemed colleagues asking how we could get B2B Azure AD tenant guests to show up in the Office 365 GAL. I thought, “Yeah, that should be something that’s possible. I mean, they have email addresses.”… [ Continue reading ]
Update to the Create-LabUsers tool – now, with bigger foo
Update: I’ve added a shortlink for this tool: http://aka.ms/createlabusers.
In my quest to make the perfect tool for creating a realistic Lab Environment, I have added yet another feature, based on requests that I imagine people are making but have not yet told me about. … [ Continue reading ]
Generate Lorem Ipsum Text
While adding features to my latest update of the Create-LabUsers tool, I wanted to provide a way to generate and send test email data to randomized recipients. While generating a random list of recipients wasn’t terribly hard, what did take a bit more work is generating random text. … [ Continue reading ]
Update to Create-LabUsers tool
Update: I’ve added a shortlink for this tool: http://aka.ms/createlabusers.
Because you didn’t ask for it, I went ahead and added to it.
Well, that’s a lie. I actually had some really great ideas and feedback, so I’ve added a few new features that I wanted to draw attention to:
- Detect existing Exchange session – If you cancel the script to create mailboxes while it’s running, you previously needed to run a Remove-PSSession to close the open Exchange session.
Random things with Get-Random
Today’s post is less about anything in particular than it is about jotting a few things down for personal reference.
I learned a couple of things over the last week while developing a tool. I’m sure I learned them once before, but as a person with finite storage and recall capacity, this tidbits were replaced by something I perceived to be of more timely import at the time (such as my kids’ birthday gifts, picking up a suit at the cleaners, a really great Detroit style pizza recipe I’ve finally put the finishing touches on, and how I’ve recently become a fan of grass-fed butter (well, technically butter made from milk produced by grass-fed cows, since you can’t really get butter to eat anything successfully)).… [ Continue reading ]
Send Authenticated SMTP with PowerShell
Today, while I was testing out some transport rules, I wanted to send a bunch of test messages to make sure they were firing correctly. I wanted to create some custom messages and be able to automate them, and I wanted to use an outside relay service that requires SMTP authentication.… [ Continue reading ]
Trapping your favorite exceptions
Like most folks, I hate errors.
As a scripter, I hate seeing blood on the screen–to me, it means failure that I didn’t anticipate. When you’re trying to put tools out there for other folks to use, nothing toasts your peer’s or customer’s confidence like a tool that doesn’t fix itself or errors out without explanation.… [ Continue reading ]
Create realistic lab users
Update: I’ve added a shortlink for this tool: http://aka.ms/createlabusers.
In testing out some of my other tools over the last few weeks, I’ve found it necessary to create a some test users. A lot of test users. Not a normal “a lot,” either. … [ Continue reading ]
Update to the “Migrate EOP Settings” Tool
A little over a year and a half ago, I started working on a tool for a really large Office 365 / BPOS-Dedicated migration to Office 365 Government Community Cloud. As part of that migration, I wrote this tool: Migrating EOP Settings Between Tenants. … [ Continue reading ]
