PowerShell command-line tips/tricks

It's been a busy week! Had a few long travels, took the AZ-800 (Administering Windows Server Hybrid Core Infrastructure) exam which I passed, and had a great Tech Day at the office. We had a keynote from Microsoft (Azure Arc) and multiple sessions from my colleagues of which I attended the Azure Landing Zones and the Terraform session. Always nice to see colleagues enthusiastic about the things they are working on. So I didn't have time for a long blog post, this short one is about some command-line tips/tricks that I use often 🙂

Using PowerShell on Linux

Personally, I run PowerShell on my Windows 11 laptop, but I also have Linux VMs and use PowerShell on those too. In this blog post, I will show you two ways in which you can install PowerShell on your Linux machine and yes, I know... There are different Linux Operating Systems with different package managers, in my case I used Ubuntu 22.04 🙂

Import Exchange Relay Connector IP-Addresses to IIS SMTP instance

For one of our customers, who's moving away from their On-Premise Exchange 2016 server, I needed to move all the relay connectors (Used by legacy applications, appliances, and hardware) to an IIS SMTP instance. Pretty straightforward, but typing the long list of addresses myself... No 🙂 In this blog post, I will show you a way to easily migrate the IP-Addresses from a Receive Connector into an IIS SMTP instance.

Retrieve all local group members of Active Directory member servers

For one of our customers, we needed a report on all local groups and their members on all Active Directory joined servers. You can connect all servers one by one with Computer Management and check, but hey... PowerShell is there for you 🙂 In this blog post, I will show you an easy way to get a report on the memberships, and yes... I used the ImportExcel module too (Needed for the Export-Excel cmdlet) 😀

Using PSScriptAnalyzer to optimize your PowerShell scripts

I use Visual Studio Code for writing PowerShell scripts, which makes formatting and writing so much easier. Even though it shows you things that you shouldn't do, for example using aliases, you can get even more tips and hints to make your code even better. This blog post will show you how to use the PSScriptAnalyzer module which can give you some additional hints that Visual Studio Code doesn't show you.