<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Powershell on justinverstijnen.nl</title><link>https://projectkaasplank.justinverstijnen.nl/categories/powershell/</link><description>Recent content in Powershell on justinverstijnen.nl</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 12 Apr 2026 17:09:27 +0200</lastBuildDate><atom:link href="https://projectkaasplank.justinverstijnen.nl/categories/powershell/index.xml" rel="self" type="application/rss+xml"/><item><title>Windows Server Inventory Report Script</title><link>https://projectkaasplank.justinverstijnen.nl/windows-server-inventory-report-script/</link><pubDate>Thu, 13 Nov 2025 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/windows-server-inventory-report-script/</guid><description>&lt;p&gt;To help us IT identifying certain configurations on a server and possible misconfigurations I have made a PowerShell script which creates a complete overview of the current server configuration and exports it as a single HTML file.&lt;/p&gt;
&lt;p&gt;In this post I will explain how to use it and how the script works.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://sajvwebsiteblobstorage.blob.core.windows.net/blog/windows-server-inventory-report-script-3866/jv-media-3866-047721edba6f.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;An example of the output of the script.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="where-to-download-this-script"&gt;Where to download this script?&lt;a class="td-heading-self-link" href="#where-to-download-this-script" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For the fast pass, my script can be downloaded here:&lt;/p&gt;</description></item><item><title>Clean files on a schedule with Powershell script</title><link>https://projectkaasplank.justinverstijnen.nl/clean-files-on-schedule-with-powershell-retention-script/</link><pubDate>Thu, 18 Sep 2025 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/clean-files-on-schedule-with-powershell-retention-script/</guid><description>&lt;p&gt;Sometimes in IT, we have software or solutions that need to to save temporary files in your filesystem. Let&amp;rsquo;s say, a feed with logs or CSV files that are saved, logs or back-ups like the Bartender software. The software itself doesn&amp;rsquo;t have a solution to clean up those files and after 2 years, the size can be massive.&lt;/p&gt;
&lt;p&gt;To let this files clean on schedule I have created a Powershell script which cleans those files in specific folders after they are not modified in *specfied* days . You can define the folders and number of days at the parameters section of the script.&lt;/p&gt;</description></item><item><title>How to completely hide language bar/selector Windows 11</title><link>https://projectkaasplank.justinverstijnen.nl/how-to-completely-hide-language-bar-selector-windows-11/</link><pubDate>Tue, 09 Sep 2025 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/how-to-completely-hide-language-bar-selector-windows-11/</guid><description>&lt;p&gt;One of the small things I experienced in one of the updates for Windows 11 (24H2) is that the language bar/selector get&amp;rsquo;s automatically visible on the Windows taskbar. In previous versions of Windows, this was only available when using multiple keyboard languages.&lt;/p&gt;
&lt;p&gt;Because this can get very annoying, I researched on how to disable this button to clean up our taskbar and only use it for the applications and space we need.&lt;/p&gt;</description></item><item><title>Initial Installation script for Windows Azure VMs</title><link>https://projectkaasplank.justinverstijnen.nl/initial-installation-script-for-windows-azure-vms/</link><pubDate>Sun, 10 Aug 2025 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/initial-installation-script-for-windows-azure-vms/</guid><description>&lt;p&gt;When deploying Windows VMs in Azure, we get the default settings. This means we get a 12-hour clock, standard UTC/Zulu timezone and such. For users like us in the Netherlands we want to change this but not by hand.&lt;/p&gt;
&lt;p&gt;For this purpose I built this script. It sets the timezone for Western Europe and sets the clock to 24-hour system. It also does some bonusses like responding to ping and disabling the IE Enhanced Security as it&amp;rsquo;s mostly server focussed. We don&amp;rsquo;t change the Windows language and this stays English.&lt;/p&gt;</description></item><item><title>Installing Windows Updates through PowerShell (script)</title><link>https://projectkaasplank.justinverstijnen.nl/installing-windows-updates-through-powershell-script/</link><pubDate>Sun, 27 Jul 2025 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/installing-windows-updates-through-powershell-script/</guid><description>&lt;p&gt;Sometimes we want to install updates by hand because of the need for fast patching. But logging into every server and installing them manually is a hell of a task and takes a lot of time.&lt;/p&gt;
&lt;p&gt;I have made a very simple script to install Windows Updates by hand using PowerShell including logging to exactly know which updates there were installed for monitoring later on.&lt;/p&gt;
&lt;p&gt;The good part about this script/PowerShell module is that it does support both Windows Client and Windows Server installations.&lt;/p&gt;</description></item><item><title>Disk cleaning script on Windows Azure VMs</title><link>https://projectkaasplank.justinverstijnen.nl/disk-cleaning-script-on-windows-azure-vms/</link><pubDate>Sat, 28 Jun 2025 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/disk-cleaning-script-on-windows-azure-vms/</guid><description>&lt;p&gt;On Windows Servers, a critical point is maintaining the disk space. If a disk fills up to the end, several errors can occur and impacting the end-users experience of your applications. Something we definitely not want.&lt;/p&gt;
&lt;p&gt;To help reducing this chance, I have created a PowerShell script that cleans up your server using built in tools of Windows. In this post, I will explain what the script does, how to install it and how to use it.&lt;/p&gt;</description></item><item><title>Skrepr Tech CI - PowerShell</title><link>https://projectkaasplank.justinverstijnen.nl/skrepr-tech-ci-powershell/</link><pubDate>Thu, 24 Apr 2025 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/skrepr-tech-ci-powershell/</guid><description>&lt;p&gt;Dit is mijn Collective Intelligence voor mei 2025 over PowerShell. Ik ga hier wat leuke dingen over laten zien, zie de inhoud voor handige links naar de kopteksten.&lt;/p&gt;
&lt;p&gt;Aan het einde heb ik nog een leuke praktijkopdracht waarin we een PowerShell module gaan installeren en uitvoeren.&lt;/p&gt;
&lt;p&gt;Ik heb mijn best gedaan om de uitleg zo simpel maar duidelijk te geven, ook voor onze niet-technische mensen.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="wat-is-powershell"&gt;Wat is PowerShell?&lt;a class="td-heading-self-link" href="#wat-is-powershell" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Powershell is een shell en script taal en sinds Windows 8/Server 2012 de onderliggende CLI van Windows. Eigenlijk alles in de grafische interface van Windows wordt door Powershell verwerkt, zoals te zien in onderstaande afbeelding:&lt;/p&gt;</description></item><item><title>Get Device serial number on Windows 11 24H2 and up</title><link>https://projectkaasplank.justinverstijnen.nl/get-device-serial-number-on-windows-11-24h2-and-up/</link><pubDate>Wed, 22 Jan 2025 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/get-device-serial-number-on-windows-11-24h2-and-up/</guid><description>&lt;p&gt;With Windows 24H2 and the deprecation of WMIC, a easy command to find your devices&amp;rsquo; serial number is gone. However, we can still look this up with Powershell.&lt;/p&gt;
&lt;p&gt;Use the following command:&lt;/p&gt;

 &lt;div class="td-card card border me-4"&gt;
&lt;div class="card-header code"&gt;
 &lt;strong&gt;POWERSHELL&lt;/strong&gt;
 &lt;/div&gt;
&lt;div class="card-body code p-0 m-0"&gt;
 &lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;Get-WmiObject&lt;/span&gt; &lt;span class="n"&gt;win32_bios&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="nb"&gt;select &lt;/span&gt;&lt;span class="n"&gt;SerialNumber&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
 &lt;/div&gt;

&lt;script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4082816808518335"
 crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;ins class="adsbygoogle"
 style="display:block; text-align:center;"
 data-ad-layout="in-article"
 data-ad-format="fluid"
 data-ad-client="ca-pub-4082816808518335"
 data-ad-slot="9865066433"&gt;&lt;/ins&gt;
&lt;script&gt;
 (adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h2&gt;End of the page 🎉&lt;/h2&gt;
&lt;p&gt;You have reached the end of the page. You can navigate through other blog posts as well, share this post on X, LinkedIn and Reddit or return to the blog posts collection page. Thank you for visiting this post.&lt;/p&gt;</description></item><item><title>How to upload PowerShell script to Gallery with Github Actions</title><link>https://projectkaasplank.justinverstijnen.nl/how-to-upload-powershell-script-to-gallery-with-github-actions/</link><pubDate>Thu, 02 Jan 2025 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/how-to-upload-powershell-script-to-gallery-with-github-actions/</guid><description>&lt;p&gt;When using the PowerShell Gallery to upload and publish your scripts and PowerShell modules to the world it&amp;rsquo;s recommended to use Github Actions for CI/CD to automatically update your live packages on the PowerShell Gallery. At first, this looked somewhat complex to me but it&amp;rsquo;s relatively easy.&lt;/p&gt;
&lt;p&gt;On this page I will show how I&amp;rsquo;ve uploaded scripts from Github to the PowerShell Gallery with using a Github Action.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="requirements"&gt;Requirements&lt;a class="td-heading-self-link" href="#requirements" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Around 30 minutes of your time&lt;/li&gt;
&lt;li&gt;Github account&lt;/li&gt;
&lt;li&gt;Powershell Gallery account&lt;/li&gt;
&lt;li&gt;A PowerShell script for testing to actually upload to the PowerShell Gallery&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="introduction-to-powershell-gallery"&gt;Introduction to PowerShell Gallery&lt;a class="td-heading-self-link" href="#introduction-to-powershell-gallery" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In short, the PowerShell Gallery is a public repository which contains PowerShell scripts and modules which all PowerShell users can download and install. All of this using some simple commands:&lt;/p&gt;</description></item><item><title>Create AD users with on demand script</title><link>https://projectkaasplank.justinverstijnen.nl/create-ad-users-with-on-demand-script/</link><pubDate>Fri, 27 Dec 2024 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/create-ad-users-with-on-demand-script/</guid><description>&lt;p&gt;Today I have a PowerShell script that creates users by asking the user what to fill in. This works by having a fully prepared &amp;ldquo;New-ADUser&amp;rdquo; command with all the properties filled in to have all users using the same attributes.&lt;/p&gt;
&lt;p&gt;I will explain how this script works on this page.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="the-create-ad-users-on-demand-script"&gt;The create AD users on demand script&lt;a class="td-heading-self-link" href="#the-create-ad-users-on-demand-script" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For the fast pass, the script can be downloaded from my GitHub page:&lt;/p&gt;</description></item><item><title>How to Export Active Directory (AD) users fast and easy</title><link>https://projectkaasplank.justinverstijnen.nl/how-to-export-active-directory-ad-users-fast-and-easy/</link><pubDate>Thu, 14 Nov 2024 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/how-to-export-active-directory-ad-users-fast-and-easy/</guid><description>&lt;p&gt;Sometimes we need to export all of our AD users. The one time for applying changes, sometimes for monitoring the inventory but often for licensing purposes.&lt;/p&gt;
&lt;p&gt;At this page I will show you how to export all your AD users fast and easy.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="the-export-ad-users-script"&gt;The Export AD users script:&lt;a class="td-heading-self-link" href="#the-export-ad-users-script" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;For the fast pass, I uploaded the script to my Github page:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/JustinVerstijnen/JV-ExportADUsers"&gt;Download script from GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="how-to-export-the-ad-users-by-hand"&gt;How to export the AD users by hand&lt;a class="td-heading-self-link" href="#how-to-export-the-ad-users-by-hand" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To export the users without using a script, navigate to your Active Directory management server and open up Powershell. We will do all the action the script above does, but then by hand and type in every command separately.&lt;/p&gt;</description></item><item><title>Set correct language and timezone on Azure VM</title><link>https://projectkaasplank.justinverstijnen.nl/set-correct-language-and-timezone-on-azure-vm/</link><pubDate>Thu, 10 Oct 2024 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/set-correct-language-and-timezone-on-azure-vm/</guid><description>&lt;p&gt;By default, all Azure VMs are set to English language and UTC/Zulu timezone. This will work for a great portion of the Azure VM users but there are users in other parts of the world too. Like in the Netherlands, where I live we are 1 or 2 hours ahead of that timezone depending on the season.&lt;/p&gt;
&lt;p&gt;Also, in the case of Azure Virtual Desktop, we want to present our users their native language as system language. For this case, I have made a script to correct those settings.&lt;/p&gt;</description></item><item><title>Azure Stack HCI - Host your Virtual Desktops locally</title><link>https://projectkaasplank.justinverstijnen.nl/azure-stack-hci-host-your-virtual-desktops-locally-with-all-the-best-of-azure/</link><pubDate>Thu, 03 Oct 2024 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/azure-stack-hci-host-your-virtual-desktops-locally-with-all-the-best-of-azure/</guid><description>&lt;h2 id="introduction-to-azure-stack-hci"&gt;Introduction to Azure Stack HCI&lt;a class="td-heading-self-link" href="#introduction-to-azure-stack-hci" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Azure Stack HCI is a solution for Microsoft Azure to host Azure resources on your own hardware and location. This sounds traditional but can help to boost your Azure resources for your customer and/or use case.&lt;/p&gt;
&lt;p&gt;For example, with Azure Stack HCI it is possible to host some Azure Virtual Desktop hosts in your own network to boost performance by decreasing latency. Also it is possible to use GPU enabled software on this.&lt;/p&gt;</description></item><item><title>Get Windows Product Key with PowerShell</title><link>https://projectkaasplank.justinverstijnen.nl/get-windows-product-key-with-powershell/</link><pubDate>Sun, 28 Jul 2024 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/get-windows-product-key-with-powershell/</guid><description>&lt;p&gt;Sometimes we need to have the original installed Windows Product Key just for documentation purposes. We simple can do this with one command in PowerShell:&lt;/p&gt;
&lt;p&gt;
 &lt;div class="td-card card border me-4"&gt;
&lt;div class="card-header code"&gt;
 &lt;strong&gt;POWERSHELL&lt;/strong&gt;
 &lt;/div&gt;
&lt;div class="card-body code p-0 m-0"&gt;
 &lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-powershell" data-lang="powershell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Get-ItemProperty&lt;/span&gt; &lt;span class="n"&gt;-Path&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="n"&gt;BackupProductKeyDefault&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
 &lt;/div&gt;

&lt;img src="https://sajvwebsiteblobstorage.blob.core.windows.net/blog/get-windows-product-key-with-powershell-3681/jv-media-3681-3a0bbc0e5409.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Please note that I am not encouraging software abuse or pirating, just sharing a tip to make our IT life a bit easier. It happens that a server or computer gets installed and we forget to document the product key or just to match it with our known information.&lt;/p&gt;</description></item><item><title>Using PowerShell remote sessions</title><link>https://projectkaasplank.justinverstijnen.nl/using-powershell-remote-sessions/</link><pubDate>Wed, 10 Apr 2024 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/using-powershell-remote-sessions/</guid><description>&lt;p&gt;PowerShell Remote Sessions can be a great way to administer your virtual machines, cluster-nodes or physical Windows-based devices. With a Powershell remote session you can execute powershell commands on a remote device.&lt;/p&gt;
&lt;p&gt;It works the best with servers in a specific management subnet. I do not recommend to administer client devices with Powershell because this can be a huge security risk.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="requirements"&gt;Requirements&lt;a class="td-heading-self-link" href="#requirements" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Management computer/Priveleged Access Workstation&lt;/li&gt;
&lt;li&gt;15-20 minutes of your time&lt;/li&gt;
&lt;li&gt;Management server and endpoints are Active Directory joined&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="starting-out"&gt;Starting out&lt;a class="td-heading-self-link" href="#starting-out" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before we can use Powershell to administer remote computers, we need to enable two things:&lt;/p&gt;</description></item><item><title>How to enable Remote Group Policy update</title><link>https://projectkaasplank.justinverstijnen.nl/how-to-enable-remote-group-policy-update/</link><pubDate>Wed, 10 Jan 2024 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/how-to-enable-remote-group-policy-update/</guid><description>&lt;h2 id="group-policy-update-to-multiple-computers"&gt;Group Policy update to multiple computers&lt;a class="td-heading-self-link" href="#group-policy-update-to-multiple-computers" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Sometimes you want to force a group policy update on multiple computers. Often when i am configuring Azure Virtual Desktop Session Hosts i need this option instead of logging into all hosts and executing the command manually.&lt;/p&gt;
&lt;p&gt;There is a option in Group Policy management to force a group policy update to all computers in a OU:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://sajvwebsiteblobstorage.blob.core.windows.net/blog/how-to-enable-remote-group-policy-update-534/jv-media-534-b7954db3f633.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Actually, this only works after you configured this on the remote computers. The good part is, there is a way to do this with Group Policy!&lt;/p&gt;</description></item><item><title>Bulk create Active Directory users with Powershell</title><link>https://projectkaasplank.justinverstijnen.nl/bulk-create-active-directory-users-with-powershell/</link><pubDate>Mon, 20 Mar 2023 00:00:00 +0000</pubDate><guid>https://projectkaasplank.justinverstijnen.nl/bulk-create-active-directory-users-with-powershell/</guid><description>&lt;p&gt;When it comes to creating users for Active Directory, especially in new implementations, you want to minimize the time needed to create the accounts. This is possible by creating the AD users with Powershell.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="requirements"&gt;Requirements&lt;a class="td-heading-self-link" href="#requirements" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Minimal knowledge of Powershell&lt;/li&gt;
&lt;li&gt;An Active Directory environment&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="full-script-for-creating-ad-users"&gt;Full script for creating AD users&lt;a class="td-heading-self-link" href="#full-script-for-creating-ad-users" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Here is the full script including CSV that creates the ad users:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/JustinVerstijnen/BulkCreateADDSUser"&gt;Show PowerShell script on Github&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>