Creating a function or script with PowerShell Dynamic Parameters

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. Advanced Parameters covers this nicely, including our friends ValidateSet, ValidatePattern,…

0

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) {…

0

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). You can copy/paste this and save it as…

0

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.  The result: Updated network tests for crmdynint.com Updated network tests for passport.net endpoints…

0

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…

0

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).  This method…

0

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.” In a rare turn of events, it actually is as…

2

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.  I’m going to go ahead and add ‘psychic’ to my…

0

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.  Most of us are familiar with the…

0

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…

0