Harm Veenstra
Blogs, Articles, and Posts
Active Directory Infra check using PowerShell
(powershellisfun.com)
Some of our customers have an Active Directory environment that needs upgrading, to get a good
By: Harm Veenstra submitted:Dec 2 2022
Some of our customers have an Active Directory environment that needs upgrading, to get a good
overview of their environment I always check a lot of things before writing a report and a recommendation about which steps we need to take. In this blog post, I will show you a script that gathers information about the Active Directory Domain which saves a lot of command-line checking and starting up Management Consoles 😉
By: Harm Veenstra submitted:Dec 2 2022
Add, remove, or replace values using PowerShell
(powershellisfun.com)
I had another encounter this week where a customer wanted to remove the value from something in
By: Harm Veenstra submitted:Feb 16 2024
I had another encounter this week where a customer wanted to remove the value from something in
Exchange. Setting the value to $null didn't work, and I showed him how to remove it another way. This blog post will show a few ways to add, remove, or replace a value using Active Directory and Exchange Online as examples.
By: Harm Veenstra submitted:Feb 16 2024
Adding printer drivers with Endpoint Manager and PowerShell
(powershellisfun.com)
Printers and their drivers, not always the most fun part of IT. Since PrintNightMare it has become
By: Harm Veenstra submitted:Jun 24 2022
Printers and their drivers, not always the most fun part of IT. Since PrintNightMare it has become
more difficult for users to add printers to their workstation, this blogpost describes how you can add printers using Endpoint Manager and PowerShell in a easy way.
By: Harm Veenstra submitted:Jun 24 2022
Check for non-Microsoft signed Windows Services
(powershellisfun.com)
I have a lot of Windows Services on my Windows 11 laptop, mainly from Microsoft itself or
By: Harm Veenstra submitted:Oct 27 2023
I have a lot of Windows Services on my Windows 11 laptop, mainly from Microsoft itself or
third-party, but Microsoft signed are safe(r). In this blog post, I will show you how you can scan your system for non-Microsoft signed Windows Services and create a report on those.
By: Harm Veenstra submitted:Oct 27 2023
Check for PowerShell module updates
(powershellisfun.com)
Last year, I wrote a blog post about updating your modules to the latest version, including removing
By: Harm Veenstra submitted:Sep 22 2023
Last year, I wrote a blog post about updating your modules to the latest version, including removing
the older versions here. This blog post will show you how to check for updated modules.
By: Harm Veenstra submitted:Sep 22 2023
Configuring NTFS permissions using PowerShell
(powershellisfun.com)
Configuring NTFS permissions is something that you can do using your Windows Explorer, Server
By: Harm Veenstra submitted:May 5 2023
Configuring NTFS permissions is something that you can do using your Windows Explorer, Server
Manager, or by using command-line tools like subinacl.exe or icacls.exe. In this blog post, I will show you how to set NTFS permissions in two different ways using PowerShell 🙂
By: Harm Veenstra submitted:May 5 2023
Configuring PowerShell settings using Intune or Group Policy
(powershellisfun.com)
Every Windows device has PowerShell installed by default. (Sadly, it's still only version 5, not
By: Harm Veenstra submitted:Sep 6 2024
Every Windows device has PowerShell installed by default. (Sadly, it's still only version 5, not
version 7.) However, you want to configure the devices' security and log settings. In this blog post, I will show you how to do that using Microsoft Intune or Group Policy.
By: Harm Veenstra submitted:Sep 6 2024
Create a report on local DNS lookups using PowerShell
(powershellisfun.com)
When troubleshooting a system, you sometimes need to know what DNS lookups are being done. This will
By: Harm Veenstra submitted:Sep 2 2022
When troubleshooting a system, you sometimes need to know what DNS lookups are being done. This will
give you a good insight into traffic from the systems to the local network or internet. You can do this with DNS auditing on your Windows server or in your local Pihole server, but that's not always available
By: Harm Veenstra submitted:Sep 2 2022
Create a TCP/UDP port listener using PowerShell
(powershellisfun.com)
One of our customers is securing his network and firewall changes were made that needed to be
By: Harm Veenstra submitted:Aug 12 2022
One of our customers is securing his network and firewall changes were made that needed to be
tested. In this case, the new servers were not deployed in that specific network yet. But... We did want to test the connections before deploying the servers 🙂 In this blog post, I will show you a way how to create listening ports on a machine in order to test the connection from another network using netcat on Linux or portqry on Windows.
By: Harm Veenstra submitted:Aug 12 2022
Creating a development Windows Sandbox using PowerShell and WinGet
(powershellisfun.com)
As I mentioned before, I like Windows Sandbox! However, since Windows 11 24H2, Windows Sandbox has
By: Harm Veenstra submitted:Aug 9 2024
As I mentioned before, I like Windows Sandbox! However, since Windows 11 24H2, Windows Sandbox has
been missing two things I often use: Notepad and Windows ISE. In this blog post, I will show you how to start Windows Sandbox and automatically install your preferred editors and tools using WinGet and PowerShell.
By: Harm Veenstra submitted:Aug 9 2024
Custom Compliance PowerShell script for detecting additional local Administrators
(powershellisfun.com)
One of our customers wanted to be sure that there were no additional accounts in the local
By: Harm Veenstra submitted:Apr 21 2023
One of our customers wanted to be sure that there were no additional accounts in the local
Administrators group on their Intune devices, and... That's where Custom Compliance policies come in 🙂 In this blog post, I will show you how to automatically check the Administrators group and mark the device as non-compliant if needed.
By: Harm Veenstra submitted:Apr 21 2023
Deprecated PowerShell Modules and Azure AD Graph retirement
(powershellisfun.com)
You created a script or function a while back that people in the company use a lot, and suddenly...
By: Harm Veenstra submitted:May 17 2024
You created a script or function a while back that people in the company use a lot, and suddenly...
They come to you telling you that it doesn't work anymore. 🙁 The module you used has become deprecated, cmdlets don't all work anymore, etc. In this blog post, I will show the three most prominent modules that have become deprecated and where you can find good information about the successor to adjust your scripts.
By: Harm Veenstra submitted:May 17 2024
Display Markdown files in PowerShell
(powershellisfun.com)
Creating Markdown files is something that I do regularly, usually in Visual Studio Code or
By: Harm Veenstra submitted:Aug 30 2024
Creating Markdown files is something that I do regularly, usually in Visual Studio Code or
Obsidian. But when working in a Windows Terminal or a standard PowerShell prompt, it's nice to display those .md files in those, too, with all the formatting that Markdown gives you. In this blog post, I will show you how 🙂
By: Harm Veenstra submitted:Aug 30 2024
Editing PowerShell scripts in Azure Cloud Shell
(powershellisfun.com)
Executing PowerShell scripts in Azure Cloud Shell is easy and fast, but how do you edit them before
By: Harm Veenstra submitted:May 19 2023
Executing PowerShell scripts in Azure Cloud Shell is easy and fast, but how do you edit them before
running? I will show you three ways to do that in this blog post.
By: Harm Veenstra submitted:May 19 2023
Export registry information using PowerShell
(powershellisfun.com)
At the end of another busy week, and after passing the AZ-801 exam two days ago, it's time for a
By: Harm Veenstra submitted:Nov 25 2022
At the end of another busy week, and after passing the AZ-801 exam two days ago, it's time for a
small blog post 🙂 I had to export a registry from a client on which regedit tools were blocked. Exporting using PowerShell is an option, but the format isn't that great by default. In this blog post, I will show you how to export it to a friendly format.
By: Harm Veenstra submitted:Nov 25 2022
Get all Microsoft IP and FQDNs for their services
(powershellisfun.com)
When you are in an environment with strict internet access, you need to figure out what to open to
By: Harm Veenstra submitted:Sep 23 2022
When you are in an environment with strict internet access, you need to figure out what to open to
what destination for Microsoft services like Exchange Online, Teams, Endpoint Manager, and so on. Microsoft publishes this on their website but in the blog post, I would like to show you a nice way of outputting
By: Harm Veenstra submitted:Sep 23 2022
How to create and use your own PowerShell GitHub Repository
(powershellisfun.com)
I use GitHub to store all my scripts and projects. In this blog post, I will show you how to create
By: Harm Veenstra submitted:Jun 30 2023
I use GitHub to store all my scripts and projects. In this blog post, I will show you how to create
and use your GitHub repository.
By: Harm Veenstra submitted:Jun 30 2023
How to make your PowerShell scripts look better
(powershellisfun.com)
When I started writing my first PowerShell scripts. They didn't look that good, it was PowerShell
By: Harm Veenstra submitted:Jul 1 2022
When I started writing my first PowerShell scripts. They didn't look that good, it was PowerShell
2.0 of course and I was just a beginner. I'm getting better at it and the newer versions of PowerShell (And Visual Studio Code) have a few nice formatting tricks. This blogpost will show you a few ways to make your scripts look better and more importantly. A lot more readable!
By: Harm Veenstra submitted:Jul 1 2022
Install or update your SysInternals Suite using PowerShell
(powershellisfun.com)
I think a lot of you use the SysInternals tools on your machine. They are great tools at your
By: Harm Veenstra submitted:Jan 27 2023
I think a lot of you use the SysInternals tools on your machine. They are great tools at your
disposal and have helped me a lot! You can install it using the Microsoft Store method, it will be updated like that too, but for your management server, it's nice to have an installer that works without the Microsoft Store 🙂 In this blog post, I will show you a way to install or update your SysInternals Suite.
By: Harm Veenstra submitted:Jan 27 2023
Intune Proactive Remediation for “Microsoft Windows Unquoted Service Path” / CVE-2013-1609, CVE-2014-0759, CVE-2014-5455
(powershellisfun.com)
Microsoft Defender has security recommendations for the "Fix unquoted service path for Windows
By: Harm Veenstra submitted:May 5 2023
Microsoft Defender has security recommendations for the "Fix unquoted service path for Windows
services." (CVE-2013-1609, CVE-2014-0759, CVE-2014-5455) These might be reported for things like Dell services, and you can fix them manually by editing the Registry on the affected device. But... There is an easier way 🙂 This blog post will show you how to create a Proactive Remediation in Intune for it.
By: Harm Veenstra submitted:May 5 2023
Jupyter notebooks in VSCode with PowerShell support
(powershellisfun.com)
Saw a video about Jupyter in Visual Studio Code a while back, tried to get it up and running and...
By: Harm Veenstra submitted:Aug 5 2022
Saw a video about Jupyter in Visual Studio Code a while back, tried to get it up and running and...
It seems that that things are changed now, it was there in VSCode preview versions together with the PowerShell preview extension. All the How-To's I found showed me that way of getting it installed/configured. So I played around a little bit with Jupyter and the PowerShell kernel installation and got it working in VSCode, in this blogpost I will show you how to install and configure everything 🙂
By: Harm Veenstra submitted:Aug 5 2022
Microsoft Intune PowerShell Additional Requirement Rules
(powershellisfun.com)
In my last blog post, I showed you how to use Detection scripts in Intune. In this blog post, I will
By: Harm Veenstra submitted:Dec 15 2023
In my last blog post, I showed you how to use Detection scripts in Intune. In this blog post, I will
show you how the additional requirement rules work and how you can use PowerShell for those.
By: Harm Veenstra submitted:Dec 15 2023
Microsoft Intune PowerShell Detection scripts
(powershellisfun.com)
When I deploy Win32 packages in Intune, I use PowerShell detection scripts to detect if the software
By: Harm Veenstra submitted:Dec 1 2023
When I deploy Win32 packages in Intune, I use PowerShell detection scripts to detect if the software
is installed on a system. In the blog post, I will show you how they work and why they are more flexible than file and registry checks. What are detection scripts in Intune?
By: Harm Veenstra submitted:Dec 1 2023
My first experience trying to use the PowerShell beta module for Microsoft 365 Backup
(powershellisfun.com)
I use Microsoft 365 Backup for my tenant; it's a simple way to back up Exchange, OneDrive, and
By: Harm Veenstra submitted:Aug 23 2024
I use Microsoft 365 Backup for my tenant; it's a simple way to back up Exchange, OneDrive, and
SharePoint data to an Azure Subscription. There was no PowerShell module to query and configure things, but that has changed because the Beta module was released three days ago. In this blog post, I will describe my first experience trying to use the new module.
By: Harm Veenstra submitted:Aug 23 2024
My PowerShell for Visual Studio Code extension settings
(powershellisfun.com)
I use Visual Studio Code to create and edit PowerShell scripts. The PowerShell Extension from
By: Harm Veenstra submitted:Sep 13 2024
I use Visual Studio Code to create and edit PowerShell scripts. The PowerShell Extension from
Microsoft has some excellent features that will make your scripts more readable and consistent formatting-wise. In this blog post, I will show you my configuration and the options I use.
By: Harm Veenstra submitted:Sep 13 2024
Parameters for PowerShell Scripts and Functions
(powershellisfun.com)
Using parameters for your Scripts and Functions is very powerful. You don't have to hardcode things
By: Harm Veenstra submitted:May 24 2024
Using parameters for your Scripts and Functions is very powerful. You don't have to hardcode things
in them, making running them from a command line easier. This blog post will show you the parameters I use in most of my scripts and how they work.
By: Harm Veenstra submitted:May 24 2024
PowerShell 5 and 7 command-line parameters
(powershellisfun.com)
You can start PowerShell 5 (powershell.exe) and PowerShell 7 (pwsh.exe) and specify parameters. This
By: Harm Veenstra submitted:Mar 8 2024
You can start PowerShell 5 (powershell.exe) and PowerShell 7 (pwsh.exe) and specify parameters. This
blog post will show you the parameters I use most for version 5 or 7.
By: Harm Veenstra submitted:Mar 8 2024
PowerShell and JSON
(powershellisfun.com)
JSON is something that's being used a lot, it's easy for storing and retrieving data. In this small
By: Harm Veenstra submitted:Aug 12 2022
JSON is something that's being used a lot, it's easy for storing and retrieving data. In this small
blog post, I will show you how to do that 🙂
By: Harm Veenstra submitted:Aug 12 2022
PowerShell Arrays
(powershellisfun.com)
You probably use it all the time in your scripts, but how do they work? In this blog post, I will
By: Harm Veenstra submitted:Jun 14 2024
You probably use it all the time in your scripts, but how do they work? In this blog post, I will
show some simple examples of what you can do with them 🙂
By: Harm Veenstra submitted:Jun 14 2024
PowerShell Automatic Variables
(powershellisfun.com)
They are there for you, but sometimes you forget they are there... Automatic Variables! In this blog
By: Harm Veenstra submitted:Jun 23 2023
They are there for you, but sometimes you forget they are there... Automatic Variables! In this blog
post, I will show you some examples and why they are so helpful!
By: Harm Veenstra submitted:Jun 23 2023
PowerShell data/reference types for variables
(powershellisfun.com)
When you store data in a variable, PowerShell can store it how you want it to be if you use the
By: Harm Veenstra submitted:Apr 12 2024
When you store data in a variable, PowerShell can store it how you want it to be if you use the
correct data type. This blog post will show you how that works and which data types I mostly use for my scripts.
By: Harm Veenstra submitted:Apr 12 2024
PowerShell Out-ConsoleGridView and F7History
(powershellisfun.com)
I saw these two console tools for PowerShell in my newsfeed, and I like them 🙂 This blog post will
By: Harm Veenstra submitted:Jul 28 2023
I saw these two console tools for PowerShell in my newsfeed, and I like them 🙂 This blog post will
show you what they are and how they work.
By: Harm Veenstra submitted:Jul 28 2023
PowerShell output on screen
(powershellisfun.com)
It's always nice to have some screen output while running scripts interactively, in this blog post I
By: Harm Veenstra submitted:Dec 16 2022
It's always nice to have some screen output while running scripts interactively, in this blog post I
will show you a few ways to do that.
By: Harm Veenstra submitted:Dec 16 2022
PowerShell Profile
(powershellisfun.com)
It's being used in every PowerShell session, the PowerShell Profile. In this blog post, I will show
By: Harm Veenstra submitted:Jul 14 2023
It's being used in every PowerShell session, the PowerShell Profile. In this blog post, I will show
you what it does, what you can use it for, and how I use it.
By: Harm Veenstra submitted:Jul 14 2023
PowerShell PSDrive
(powershellisfun.com)
This is sometimes forgotten, the easy way of accessing or checking network drives, certificates,
By: Harm Veenstra submitted:Jul 19 2024
This is sometimes forgotten, the easy way of accessing or checking network drives, certificates,
registry, variables, etc. In this blog post, I will show you what a PSDrive does and some examples of its use.
By: Harm Veenstra submitted:Jul 19 2024
PowerShell tips and tricks
(powershellisfun.com)
Over the years I learned a lot of PowerShell tricks but also stopped using a few because they are
By: Harm Veenstra submitted:Jul 28 2022
Over the years I learned a lot of PowerShell tricks but also stopped using a few because they are
out-dated or not that smart to use them anymore performance wise. In this blogpost I will share a few of them 🙂 (These are just a few, will write a new blogpost with others in the future)
By: Harm Veenstra submitted:Jul 28 2022
PowerShell, Intune, and Microsoft Graph X-Ray
(powershellisfun.com)
I used Microsoft Graph X-Ray as a tool for getting the PowerShell cmdlets needed for scripting
By: Harm Veenstra submitted:Oct 13 2023
I used Microsoft Graph X-Ray as a tool for getting the PowerShell cmdlets needed for scripting
specific actions in the Azure / Entra ID portal in the past. But you can also use it for Intune 🙂 In this blog post, I will show you how this works.
By: Harm Veenstra submitted:Oct 13 2023
PSResourceGet
(powershellisfun.com)
On October 9th, PSResourceGet became Generally Available (GA)! This blog post will show you what it
By: Harm Veenstra submitted:Oct 13 2023
On October 9th, PSResourceGet became Generally Available (GA)! This blog post will show you what it
is and how it adds to / replaces the current PowerShellGet v2.2.5.
By: Harm Veenstra submitted:Oct 13 2023
Query the required permissions of a Microsoft Graph cmdlet
(powershellisfun.com)
Microsoft Graph can be difficult sometimes. There are loads of PowerShell Microsoft Graph Modules
By: Harm Veenstra submitted:Sep 20 2024
Microsoft Graph can be difficult sometimes. There are loads of PowerShell Microsoft Graph Modules
and cmdlets that require different permissions. In this blog post, I will show you how to query the permissions for a cmdlet, multiple cmdlets, or all cmdlets from a specific Microsoft Graph module.
By: Harm Veenstra submitted:Sep 20 2024
Query WinGet software installer data with PowerShell
(powershellisfun.com)
I'm a big fan of WinGet, and the software available in their ecosystem is growing daily. Still, I'm
By: Harm Veenstra submitted:Oct 18 2024
I'm a big fan of WinGet, and the software available in their ecosystem is growing daily. Still, I'm
always curious about what WinGet will download and how it does the silent install of the specified software. In this blog post, I will show you an easy way of retrieving that data 🙂
By: Harm Veenstra submitted:Oct 18 2024
Recreate Desktop and Start Menu shortcuts #ASRmageddon
(powershellisfun.com)
It's just a beautiful Friday 13th, due to a Windows Defender update that removed shortcuts from many
By: Harm Veenstra submitted:Jan 20 2023
It's just a beautiful Friday 13th, due to a Windows Defender update that removed shortcuts from many
machines with Attack Surface Reduction enabled for Macros. (Work-around "Setdefender ASR rule 92e97fa1-2edf-4476-bdd6-9dd0b4dddc7b to audit only unit issue is resolved.") This blog post describes how you can recreate the missing shortcuts and deploy this using Intune or run it manually on the affected system(s).
By: Harm Veenstra submitted:Jan 20 2023
Remote Visual Studio Code PowerShell development on a Windows Sandbox instance
(powershellisfun.com)
You can develop PowerShell scripts on your workstation and run and test them there too... But
By: Harm Veenstra submitted:Jun 2 2023
You can develop PowerShell scripts on your workstation and run and test them there too... But
sometimes... That's not what you want. You could break your workstation with PowerShell code, and your workstation is not clean with all features installed, or settings enabled that your target systems don't. And that's where Visual Studio Code and its Remote SSH extension come into play. This blog post will show you how to combine that with a Windows Sandbox instance.
By: Harm Veenstra submitted:Jun 2 2023
Report from which PowerShell module the cmdlets are from
(powershellisfun.com)
We all encountered this: you get a script or function that uses a certain cmdlet... And it fails
By: Harm Veenstra submitted:Apr 19 2024
We all encountered this: you get a script or function that uses a certain cmdlet... And it fails
because the cmdlet is not recognized 🙁 But which module should you install to get the script working? Or does your script install or import all the required modules? In this blog post, I will show you how to check from which module(s) the cmdlet(s) originate and if they are present on your system or if you should install them.
By: Harm Veenstra submitted:Apr 19 2024
Report on Active Directory Container permissions using PowerShell
(powershellisfun.com)
In a previous blog post (Link), I showed a way to create a report on OU (Organizational Unit)
By: Harm Veenstra submitted:Aug 26 2022
In a previous blog post (Link), I showed a way to create a report on OU (Organizational Unit)
permissions. One of the replies I got about that was: How about the Container permissions, those are important too 🙂 And that's correct, they are! In this blog post, I will show you how to create a report on those (Script is based on the OU report)
By: Harm Veenstra submitted:Aug 26 2022
Report on Active Directory OU permissions using PowerShell
(powershellisfun.com)
For one of our customers we are working on restricting permissions of admin accounts by implementing
By: Harm Veenstra submitted:Jul 22 2022
For one of our customers we are working on restricting permissions of admin accounts by implementing
Role Based Access and delegating permissions on Organizational Units (OU's). But one of the first questions was. What are the current permissions and what should we remove and where? In this blogpost I will show you a way to report on the current permissions so that you can remove them where they shouldn't be granted
By: Harm Veenstra submitted:Jul 22 2022
Retrieve Coinmarketcap information using PowerShell
(powershellisfun.com)
If you're into Crypto and would like to see the latest price of your precious coin, then perhaps
By: Harm Veenstra submitted:Dec 2 2022
If you're into Crypto and would like to see the latest price of your precious coin, then perhaps
this is a blog post for you 🙂 In this blog post, I will show you a way how you can use the API from Coinmarketcap to show you the latest stats in every newly started PowerShell session.
By: Harm Veenstra submitted:Dec 2 2022
Retrieve Email DNS records using PowerShell
(powershellisfun.com)
I have been doing a lot of Exchange on-prem to Exchange Online migrations the last few years,
By: Harm Veenstra submitted:Jun 24 2022
I have been doing a lot of Exchange on-prem to Exchange Online migrations the last few years,
because of that I use mxtoolbox.com a lot for querying of MX, SPF, DMARC and DKIM records. Wouldn't it be convenient to get a simple overview of those records in a PowerShell function? This blogpost will show you how
By: Harm Veenstra submitted:Jun 24 2022
Retrieve local and remote PowerShell logs
(powershellisfun.com)
There are a few PowerShell EventLogs and some files containing your PowerShell history and the
By: Harm Veenstra submitted:Aug 25 2023
There are a few PowerShell EventLogs and some files containing your PowerShell history and the
commands, script blocks, etc., that you have used. This can be very helpful if your computer or servers are hacked at your office. Or, if you just want to check things 😉 In this blog post, I will show you how to retrieve all those events locally and remotely and save those in an Excel sheet.
By: Harm Veenstra submitted:Aug 25 2023
Retrieve synopsis and help URLs for all PowerShell cmdlets/functions in your Modules
(powershellisfun.com)
Sometimes you search for cmdlets in your Modules and don't know what they do. You can use Get-Help
By: Harm Veenstra submitted:Jul 21 2023
Sometimes you search for cmdlets in your Modules and don't know what they do. You can use Get-Help
*something* to find them and Get-Help afterward for more information on those results. That or using Google for more information... In this blog post, I will show you a way to create a report with all that information in one overview 🙂
By: Harm Veenstra submitted:Jul 21 2023
Running Azure Cloud Shell locally using Docker
(powershellisfun.com)
Azure Cloud Shell is a tool I use often and is easy to access from the Admin pages in Azure and 365.
By: Harm Veenstra submitted:Feb 23 2024
Azure Cloud Shell is a tool I use often and is easy to access from the Admin pages in Azure and 365.
You can also use those tools in a local container and connect to it using the command line or Visual Studio Code. In this blog post, I will show you how to install everything and connect and use it locally.
By: Harm Veenstra submitted:Feb 23 2024
Searching Windows Event Logs using PowerShell
(powershellisfun.com)
For many people, it's the last place you check while troubleshooting, but the Windows Event Log is
By: Harm Veenstra submitted:Jul 7 2023
For many people, it's the last place you check while troubleshooting, but the Windows Event Log is
always a good start to pinpoint issues on your system. In this blog post, I will show you how to search, find easily, and export Windows Event Log information.
By: Harm Veenstra submitted:Jul 7 2023
Server-Side-Filtering in PowerShell
(powershellisfun.com)
Retrieving objects in your scripts is something that you do regularly. It takes a long time to
By: Harm Veenstra submitted:Jan 27 2023
Retrieving objects in your scripts is something that you do regularly. It takes a long time to
download and process in larger environments, wasting CPU and time. This blog post will explain how to speed up scripts by filtering server-side before downloading all results and filtering afterward.
By: Harm Veenstra submitted:Jan 27 2023
Test if Microsoft services TCP ports are accessible
(powershellisfun.com)
In a previous blog post, I showed a way to retrieve all the Microsoft Services FQDNs, ports, and
By: Harm Veenstra submitted:Sep 30 2022
In a previous blog post, I showed a way to retrieve all the Microsoft Services FQDNs, ports, and
IP-Addresses. Nice to know those in secure environments where not everything is allowed to go onto the internet, but how can you test if they are accessible? This blog post will show how to test most of these services using PowerShell.
By: Harm Veenstra submitted:Sep 30 2022
Things I use most in my PowerShell scripts
(powershellisfun.com)
Looking back at the scripts I created the last year, certain things always come back in most of
By: Harm Veenstra submitted:Aug 4 2023
Looking back at the scripts I created the last year, certain things always come back in most of
them. In this blog post, I will show you a few and explain them.
By: Harm Veenstra submitted:Aug 4 2023
Use PowerShell to create report of a DTS Compliant NPS log
(powershellisfun.com)
One of our customers had issues authenticating clients using NPS. One of the first things you do
By: Harm Veenstra submitted:Mar 29 2024
One of our customers had issues authenticating clients using NPS. One of the first things you do
is... I read the NPS logs, and they were DTS Compliant formatted, a bit of a pain to read and search ?? So, I used PowerShell to create a nice log for me in either a GridView or ... Continue reading Use PowerShell to create report of a DTS Compliant NPS log
By: Harm Veenstra submitted:Mar 29 2024
Using $using in PowerShell for local variables in remote sessions
(powershellisfun.com)
When running scripts that connect to remote systems using Invoke-Command, you can use your local
By: Harm Veenstra submitted:May 10 2024
When running scripts that connect to remote systems using Invoke-Command, you can use your local
variables in the remote session which makes things a lot easier. In this blog post, I will show you how 🙂
By: Harm Veenstra submitted:May 10 2024
Using a specific PowerShell profile for a Console session, Windows Terminal, PowerShell ISE, or Visual Studio Code
(powershellisfun.com)
I ran into this somewhere during this week. I wanted to have different PowerShell profiles for other
By: Harm Veenstra submitted:Dec 1 2023
I ran into this somewhere during this week. I wanted to have different PowerShell profiles for other
applications. (I don't need all my functions and scripts being loaded in every PowerShell session or by a Scheduled Task) In this blog post, I will show you how to change your PowerShell profiles and make them specific for an application.
By: Harm Veenstra submitted:Dec 1 2023
Using Debug and Verbose parameters in PowerShell
(powershellisfun.com)
It's one of those things you forget, and you can get a lot more output when running scripts that
By: Harm Veenstra submitted:Jun 28 2024
It's one of those things you forget, and you can get a lot more output when running scripts that
will help you find out why things are not working as you expected. This small blog post will show you how to get more verbose and debug information.
By: Harm Veenstra submitted:Jun 28 2024
Using Export-Clixml and Import-Clixml for credentials in PowerShell scripts
(powershellisfun.com)
Using clear-text passwords in PowerShell scripts is, of course, a bad thing to do. But sometimes,
By: Harm Veenstra submitted:Aug 16 2024
Using clear-text passwords in PowerShell scripts is, of course, a bad thing to do. But sometimes,
you need to use credentials in a script to connect to a server, service, etc. In this blog post, I will show you how you can use Export/Import-Clixml to do that.
By: Harm Veenstra submitted:Aug 16 2024
Using Get-Content in PowerShell
(powershellisfun.com)
I use Get-Content a lot (or cat, gc, and type as its alias) to display or track the contents of a
By: Harm Veenstra submitted:Oct 4 2024
I use Get-Content a lot (or cat, gc, and type as its alias) to display or track the contents of a
file. There are different parameters for it, and in this blog post, I will show you what you can do with those 🙂
By: Harm Veenstra submitted:Oct 4 2024
Using Get-ManagementRole to get the permissions required for Exchange-specific cmdlets
(powershellisfun.com)
I ran into an issue where one of my Exchange scripts didn't work, "a parameter could not be found
By: Harm Veenstra submitted:Nov 3 2023
I ran into an issue where one of my Exchange scripts didn't work, "a parameter could not be found
that matches the parameter..." Strange error because the parameter is there... Or is it? In this blog post, I will show you how Get-ManagementRole works in Exchange and how it can help you with issues like this.
By: Harm Veenstra submitted:Nov 3 2023
Using Measure-Command and Measure-Object in PowerShell
(powershellisfun.com)
Measuring is always a good idea for grasping things, such as how long it sometimes takes, how many
By: Harm Veenstra submitted:Jun 21 2024
Measuring is always a good idea for grasping things, such as how long it sometimes takes, how many
objects there are in a specific directory, how much space something takes up on a hard drive, etc. In this blog post, I will show you how the Measure-Command and Measure-Object cmdlets work and how you can use them to your advantage.
By: Harm Veenstra submitted:Jun 21 2024
Using Pop-Location and Push-Location in PowerShell
(powershellisfun.com)
At PSConfEU, somebody asked me if I used Pop-Location and Push-Location. Well, I know it's there,
By: Harm Veenstra submitted:Jul 12 2024
At PSConfEU, somebody asked me if I used Pop-Location and Push-Location. Well, I know it's there,
but no. 🙂 In this blog post, I will show you how to use it and that it might come in handy!
By: Harm Veenstra submitted:Jul 12 2024
Using PowerShell Direct for Hyper-V VMs
(powershellisfun.com)
I have multiple Hyper-V Vms on my laptop for testing purposes. Sometimes, you need to update those
By: Harm Veenstra submitted:May 12 2023
I have multiple Hyper-V Vms on my laptop for testing purposes. Sometimes, you need to update those
or check things, and you can do this using PowerShell Direct. In this blog post, I will show you how to use PowerShell Direct with a few examples.
By: Harm Veenstra submitted:May 12 2023
Using PowerShell on chromeOS Flex
(powershellisfun.com)
On an older laptop, I use chromeOS Flex. Easy to install, and for simple web browsing, it's a
By: Harm Veenstra submitted:Nov 18 2022
On an older laptop, I use chromeOS Flex. Easy to install, and for simple web browsing, it's a
perfect solution without any license requirement. But yeah... I also wanted to use PowerShell on that, this blog post will show you how to install and use PowerShell on chromeOS Flex.
By: Harm Veenstra submitted:Nov 18 2022
Using PowerShell on Linux
(powershellisfun.com)
Personally, I run PowerShell on my Windows 11 laptop, but I also have Linux VMs and use PowerShell
By: Harm Veenstra submitted:Oct 28 2022
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 🙂
By: Harm Veenstra submitted:Oct 28 2022
Using PowerShell to query your Ubiquiti UISP information
(powershellisfun.com)
Two days ago, I received my new Ubiquiti UISP Console, an eight-port switch/router with 10Gbit SFP+
By: Harm Veenstra submitted:Jan 5 2024
Two days ago, I received my new Ubiquiti UISP Console, an eight-port switch/router with 10Gbit SFP+
slots managed by the Ubiquiti UISP software running on my VPS in Docker. In this blog post, I will show you a few examples of how to query it using PowerShell.
By: Harm Veenstra submitted:Jan 5 2024
Using PSEdit as PowerShell editor
(powershellisfun.com)
I like using Visual Studio Code as my PowerShell script editor, but alternative editors exist. The
By: Harm Veenstra submitted:Mar 3 2023
I like using Visual Studio Code as my PowerShell script editor, but alternative editors exist. The
built-in PowerShell ISE is usually there for you on Windows, but there's a nice PowerShell module that you can use called PSEdit. In this blog post, I will show you how to use that as an alternative to VSCode.
By: Harm Veenstra submitted:Mar 3 2023
Using PSScriptAnalyzer to optimize your PowerShell scripts
(powershellisfun.com)
I use Visual Studio Code for writing PowerShell scripts, which makes formatting and writing so much
By: Harm Veenstra submitted:Oct 21 2022
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.
By: Harm Veenstra submitted:Oct 21 2022
Using Run-in-Sandbox for testing scripts and Intune packages
(powershellisfun.com)
Testing things is always essential, and Windows has a nice built-in Feature for that which is called
By: Harm Veenstra submitted:Apr 7 2023
Testing things is always essential, and Windows has a nice built-in Feature for that which is called
Windows Sandbox. You can look at this as a throwaway Windows VM, you start and use it, and afterward, there's no trace of it anymore, making it ideal for testing! In this blog post, I will show you how to test PowerShell scripts and Intune packages in Windows Sandbox.
By: Harm Veenstra submitted:Apr 7 2023
Using Switch in PowerShell
(powershellisfun.com)
Everyone uses If statements in their scripts: If this, then that. Or If not this, then that,
By: Harm Veenstra submitted:Aug 2 2024
Everyone uses If statements in their scripts: If this, then that. Or If not this, then that,
multiple If, and even Elseif. But there is another option, Switch. In this blog post, I will show you how you can use Switch and make your scripts more readable in the process 🙂
By: Harm Veenstra submitted:Aug 2 2024
Using the #Requires statement in PowerShell
(powershellisfun.com)
Sometimes you have scripts that require specific versions of modules, or if the script is started
By: Harm Veenstra submitted:Apr 28 2023
Sometimes you have scripts that require specific versions of modules, or if the script is started
with Administrator privileges, you can add checks for that in the script itself or... You can use the built-in #Requires statement for that. In this blog post, I will show you how.
By: Harm Veenstra submitted:Apr 28 2023
Using the PowerShell Profiler module
(powershellisfun.com)
The Profiler module was mentioned in the episode on January 15th of the PowerShell Podcast from PDQ
By: Harm Veenstra submitted:Feb 2 2024
The Profiler module was mentioned in the episode on January 15th of the PowerShell Podcast from PDQ
(My favorite!), and it did not cross my path earlier. In this blog post, I will show you how it works and why it's a great tool to optimize your script performance!
By: Harm Veenstra submitted:Feb 2 2024
Using the PowerShell PSWindowsUpdate module
(powershellisfun.com)
I've been using the PSWindowsUpdate module for a while now; it's very convenient when spinning up a
By: Harm Veenstra submitted:Jan 26 2024
I've been using the PSWindowsUpdate module for a while now; it's very convenient when spinning up a
test VM for a customer if you want to have it up-to-date before going through the Windows Autopilot process, for example. In this blog post, I will show you how the module works with a few examples of how I use it.
By: Harm Veenstra submitted:Jan 26 2024
Using Trace-Command in PowerShell for debugging
(powershellisfun.com)
When testing Functions in PowerShell or just executing cmdlets, you don't always get enough
By: Harm Veenstra submitted:Mar 10 2023
When testing Functions in PowerShell or just executing cmdlets, you don't always get enough
information when things don't work. The Trace-Command cmdlet is a valuable tool that gives you much information about what's going on behind the scenes. In this blog post, I will show you how to use it.
By: Harm Veenstra submitted:Mar 10 2023
Using Windows PowerShell Web Access
(powershellisfun.com)
It was first introduced in Windows Server 2012, and back then, I was amazed by it, really liked it,
By: Harm Veenstra submitted:Sep 15 2023
It was first introduced in Windows Server 2012, and back then, I was amazed by it, really liked it,
and... It's still there, even in Windows Server 2022. I will show you what it is and how it works in this blog post.
By: Harm Veenstra submitted:Sep 15 2023
Using Windows Terminal for PowerShell
(powershellisfun.com)
The Windows Terminal application has been out for a while now and it's one of the things (Next to my
By: Harm Veenstra submitted:Jul 22 2022
The Windows Terminal application has been out for a while now and it's one of the things (Next to my
Edge Browser, Teams and Outlook of course ?? ) that I start after logging into my laptop. It's a Terminal application which allows you to have multiple PowerShell (Or cmd, ssh or even WSL linux sessions) open. In this blogpost I will show you some configuration settings to make it your go-to app for command-line stuff ??
By: Harm Veenstra submitted:Jul 22 2022
Projects, Scripts, and Modules
Create a focus time countdown clock using PowerShell
(powershellisfun.com)
Sometimes you really need to finish something and notifications from your running programs keep
By: Harm Veenstra submitted:Aug 19 2022
Sometimes you really need to finish something and notifications from your running programs keep
taking away your focus. You can try using the script in this blog post to keep focused on your task, when the count-down timer is done your programs will be available again
By: Harm Veenstra submitted:Aug 19 2022
Keep Microsoft Teams status Available instead of away using PowerShell
(powershellisfun.com)
It is one of the things I hear my colleagues, and even my girlfriend, mention regularly... Why does
By: Harm Veenstra submitted:May 24 2024
It is one of the things I hear my colleagues, and even my girlfriend, mention regularly... Why does
Microsoft Teams think I'm away while I'm not / My PC isn't locked yet... I read a few solutions, setting your status duration to a date in the future, etc... Didn't work 🙁 What does work is running my simple PowerShell scripts, which I will show you in this blog post 🙂
By: Harm Veenstra submitted:May 24 2024
Report on Non-Compliant Intune devices
(powershellisfun.com)
I received a question on the Microsoft Tech Community forum regarding creating a report about
By: Harm Veenstra submitted:May 3 2024
I received a question on the Microsoft Tech Community forum regarding creating a report about
non-compliant Intune devices. The report should give insight into what device has what issue with which setting; the person asking the question was already working on a Microsoft Graph script but couldn't find a suitable way. In this blog post, I will show how to create this report. There are other scripts out there, but I always like a challenge (And Microsoft Graph can be quite a challenge sometimes 😉 )
By: Harm Veenstra submitted:May 3 2024
Report Scheduled Tasks on servers that have local or domain accounts configured
(powershellisfun.com)
For one of our customers, I needed to create a report of all Scheduled Tasks on their servers with a
By: Harm Veenstra submitted:Sep 9 2022
For one of our customers, I needed to create a report of all Scheduled Tasks on their servers with a
local or domain account configured. They needed this report because they are switching to more strict Group Policies and they needed to know what user accounts should have the "Log on as a batch job"
By: Harm Veenstra submitted:Sep 9 2022
Start Windows Sandbox with parameters
(powershellisfun.com)
Personally I use Windows Sandbox a lot for testing Endpoint Manager packages or software, sometimes
By: Harm Veenstra submitted:Jul 1 2022
Personally I use Windows Sandbox a lot for testing Endpoint Manager packages or software, sometimes
you want to start it with certain options (Connect a folder on your harddrive or start without a network connection) and you have to create a custom configuration file (.wsb) with those options. This blogpost shows you how to start Windows Sandbox using PowerShell with parameters without the need of creating multiple configuration files.
By: Harm Veenstra submitted:Jul 1 2022
Updated my scripts
(powershellisfun.com)
Sometimes you look back at your scripts and think... Hmmm, why did I use that ?! So I looked back at
By: Harm Veenstra submitted:Sep 30 2022
Sometimes you look back at your scripts and think... Hmmm, why did I use that ?! So I looked back at
some scripts, changed a few things, and updated some of the blog posts. Check them out if you haven't already 😉 (Check the sidebar for categories)
By: Harm Veenstra submitted:Sep 30 2022
Updating your PowerShell modules to the latest version plus cleaning up older versions
(powershellisfun.com)
You installed a PowerShell module on your machine and used it for a long time and suddenly.. It
By: Harm Veenstra submitted:Jul 15 2022
You installed a PowerShell module on your machine and used it for a long time and suddenly.. It
doesn't connect anymore, shows warnings that some commands are deprecated and now what?! In this blogpost I will show you a way to update all your modules to the latest version and also remove unused older versions.
By: Harm Veenstra submitted:Jul 15 2022
Books, Media, and Learning Resources
Learning PowerShell using Microsoft Learn
(powershellisfun.com)
This week, I posted a link to the PowerShell courses/learning paths on Microsoft Learn for
By: Harm Veenstra submitted:Nov 1 2024
This week, I posted a link to the PowerShell courses/learning paths on Microsoft Learn for
PowerShell; I did that because there is so much material to learn from and use as a reference/help system. In this blog post, I will show you your options at Microsoft Learn to improve your PowerShell skills.
By: Harm Veenstra submitted:Nov 1 2024
PowerShell for Linux admins
(powershellisfun.com)
During the Cloud Expo convention in the Netherlands last month, I spoke to someone who said that
By: Harm Veenstra submitted:Jan 5 2024
During the Cloud Expo convention in the Netherlands last month, I spoke to someone who said that
learning all the PowerShell commands as a Linux admin was difficult. PowerShell was built to make it easier for Linux admins to transition to it. In this blog post, I will show you how aliases work and how they help Linux Admins get started with basic PowerShell tasks.
By: Harm Veenstra submitted:Jan 5 2024
Community
My 100th post and… A PowerShellisfun logo!
(powershellisfun.com)
Congrats to Harm on hitting 100 posts. I know a bunch of them have helped add content to this weekly
By: Harm Veenstra submitted:Jun 23 2023
Congrats to Harm on hitting 100 posts. I know a bunch of them have helped add content to this weekly
list.
By: Harm Veenstra submitted:Jun 23 2023
Toot on Mastodon using API and PowerShell
(powershellisfun.com)
I wrote blog posts about how to use an API for Slack and Twitter messages, but... Mastodon is also
By: Harm Veenstra submitted:Feb 10 2023
I wrote blog posts about how to use an API for Slack and Twitter messages, but... Mastodon is also
there now, and I thought... Ok, can I Toot in Mastodon using PowerShell? This blog post will show you how 😉
By: Harm Veenstra submitted:Feb 10 2023
Fun
Changing your Windows Terminal background image
(powershellisfun.com)
I use Windows Terminal to run scripts, connect to SSH hosts, or start a WSL Ubuntu session. You can
By: Harm Veenstra submitted:Jun 9 2023
I use Windows Terminal to run scripts, connect to SSH hosts, or start a WSL Ubuntu session. You can
customize Windows Terminal in many ways, and in this blog post, I will show you how to change the background in your Profiles to a fixed or randomly selected one.
By: Harm Veenstra submitted:Jun 9 2023
Create a multiple-choice quiz using PowerShell
(powershellisfun.com)
Tomorrow I'm taking the AZ-800 (Administering Windows Server Hybrid Core Infrastructure) exam and I
By: Harm Veenstra submitted:Nov 4 2022
Tomorrow I'm taking the AZ-800 (Administering Windows Server Hybrid Core Infrastructure) exam and I
wanted to create a simple test exam quiz for myself with multiple-choice questions. This blog post will show you how to do that using an Excel file with questions and A, B, C, and D answers including the correct answer to check on.
By: Harm Veenstra submitted:Nov 4 2022
Favorite PowerShell modules that I use
(powershellisfun.com)
During the course of time, you add modules to your system, some are crucial for the things you work
By: Harm Veenstra submitted:Oct 7 2022
During the course of time, you add modules to your system, some are crucial for the things you work
on and some were used only once 😉 In this blog post, I will show you my current list of modules and tell you why I use(d) them...
By: Harm Veenstra submitted:Oct 7 2022
Get a Message Of The Day in your PowerShell session
(powershellisfun.com)
Sometimes you just need a nice inspirational quote to get some motivation ?? In this blogpost I will
By: Harm Veenstra submitted:Jul 8 2022
Sometimes you just need a nice inspirational quote to get some motivation ?? In this blogpost I will
show you how to get one each time you start a new PowerShell session.
By: Harm Veenstra submitted:Jul 8 2022
PowerShell ASCII Art
(powershellisfun.com)
I posted my Windows Terminal this week on social media channels, including LinkedIn, and received
By: Harm Veenstra submitted:Oct 4 2024
I posted my Windows Terminal this week on social media channels, including LinkedIn, and received
some responses about the login banner screen. In this blog post, I will show you an easy way to pimp your PowerShell Console 😉
By: Harm Veenstra submitted:Oct 4 2024
PowerShell Games
(powershellisfun.com)
I use PowerShell for many things, but did you know you can also play games in PowerShell? In this
By: Harm Veenstra submitted:Feb 23 2024
I use PowerShell for many things, but did you know you can also play games in PowerShell? In this
blog post, I will show you a few that are nice to play while waiting for your installation to complete or your code to compile 🙂
By: Harm Veenstra submitted:Feb 23 2024
Text-To-Speech using PowerShell
(powershellisfun.com)
Just a little fun thing for a Friday, text-to-speech! We used this many years ago at the office,
By: Harm Veenstra submitted:Sep 16 2022
Just a little fun thing for a Friday, text-to-speech! We used this many years ago at the office,
sending this to the laptop of a colleague and having fun while he's trying to figure out where the voice is coming from ?? How it works There is a System.Speech assembly which can be used to
By: Harm Veenstra submitted:Sep 16 2022
Using PowerShell on your Stream Deck
(powershellisfun.com)
An excellent way to run your scripts is by using a Stream Deck ?? I purchased one last month (Elgato
By: Harm Veenstra submitted:Mar 24 2023
An excellent way to run your scripts is by using a Stream Deck ?? I purchased one last month (Elgato
Stream Deck Mk 2 Studio Controller with 15 buttons), mainly because of the Microsoft Teams support, but you can use it for PowerShell too! In this blog post, I will show you a few examples.
By: Harm Veenstra submitted:Mar 24 2023