<?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 Notities</title><link>https://19cc27e0.backup-website.pages.dev/en/tags/powershell/</link><description>Recent content in Powershell on Notities</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 15 Jul 2026 23:50:02 +0200</lastBuildDate><atom:link href="https://19cc27e0.backup-website.pages.dev/en/tags/powershell/index.xml" rel="self" type="application/rss+xml"/><item><title>Windows Server 2022 Home Lab — AD DS, DNS, CA and Secured RDP</title><link>https://19cc27e0.backup-website.pages.dev/en/blog/2026-windows-server-2022-home-lab-ad-dns-ca-rdp/</link><pubDate>Thu, 02 Apr 2026 00:00:00 +0000</pubDate><guid>https://19cc27e0.backup-website.pages.dev/en/blog/2026-windows-server-2022-home-lab-ad-dns-ca-rdp/</guid><description>&lt;p&gt;This article describes the full setup of a two-server Windows Server 2022 home lab in Proxmox VE. Together the two virtual machines provide Active Directory Domain Services, DNS, Group Policy and a Certificate Authority (ADCS). RDP connections are secured with PKI certificates so that the Mac Mini M1 management workstation connects without certificate warnings.&lt;/p&gt;
&lt;p&gt;This is part 3 of the series on building a Windows DevOps lab in Proxmox. In &lt;a href="https://vandenboom.icu/blog/2026-proxmox-windows-server-2022-vm-creation/"&gt;part 1&lt;/a&gt; I described how to create a VM, and in &lt;a href="https://vandenboom.icu/blog/2026-proxmox-windows-server-2022-template-preparation/"&gt;part 2&lt;/a&gt; how to prepare the template.&lt;/p&gt;</description></item><item><title>Proxmox Lab — Windows Server 2022 Template Preparation</title><link>https://19cc27e0.backup-website.pages.dev/en/blog/2026-proxmox-windows-server-2022-template-preparation/</link><pubDate>Tue, 31 Mar 2026 10:00:00 +0100</pubDate><guid>https://19cc27e0.backup-website.pages.dev/en/blog/2026-proxmox-windows-server-2022-template-preparation/</guid><description>&lt;p&gt;This guide covers the complete process of preparing a freshly installed Windows Server 2022 VM as a reusable Proxmox template. All future VMs (CA server, member servers, etc.) are cloned from this template, saving significant time and ensuring a consistent baseline across the entire lab.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;📄 &lt;strong&gt;Download the full guide with screenshots:&lt;/strong&gt;
&lt;a href="https://19cc27e0.backup-website.pages.dev/documents/WS2022-in-Proxmox-Template-Preparation-Guide.docx"&gt;WS2022-in-Proxmox-Template-Preparation-Guide.docx&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;The full process consists of these steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Install VirtIO guest drivers&lt;/li&gt;
&lt;li&gt;Run Windows Update — fully patch the OS&lt;/li&gt;
&lt;li&gt;Apply performance tweaks&lt;/li&gt;
&lt;li&gt;Basic housekeeping — timezone, RDP, IE Enhanced Security&lt;/li&gt;
&lt;li&gt;Sysprep — generalize and shut down&lt;/li&gt;
&lt;li&gt;Convert to template in Proxmox&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Warning:&lt;/strong&gt; Never boot the VM after Sysprep. If you do, the generalization is consumed and the template must be rebuilt from scratch.&lt;/p&gt;</description></item><item><title>PowerShell computer resource monitor script with cpu percentage and advanced memory information</title><link>https://19cc27e0.backup-website.pages.dev/en/blog/2024-powershell-computer-resource-monitor-script-with-cpu-percentage-and-advanced-memory-information/</link><pubDate>Thu, 04 Jan 2024 22:21:38 +0000</pubDate><guid>https://19cc27e0.backup-website.pages.dev/en/blog/2024-powershell-computer-resource-monitor-script-with-cpu-percentage-and-advanced-memory-information/</guid><description>&lt;p&gt;PowerShell computer resource monitor script with cpu percentage and advanced memory information&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;PowerShell

Resource monitor 


 $app=&amp;#34;notepad&amp;#34;
 $ids = Get-Process $app | Select-Object -Property Id | ForEach-Object {$_.Id}

 $filedate = Get-Date -format &amp;#34;yyyy-MM-dd&amp;#34;

 #echo $pids

 foreach ($id in $ids) {
 
 $date = Get-Date -format &amp;#34;yyyy-MM-dd HH:mm:ss&amp;#34;

 # process CPU information

 $ProcessId = $id
 $Process = Get-WmiObject -Query &amp;#34;SELECT * FROM Win32_PerfFormattedData_PerfProc_Process WHERE IDProcess = $ProcessId&amp;#34;
 $usage = $Process.PercentProcessorTime
 
 
 # process Mem information

 $TotalMemory = (Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB

 $ProcessMem = Get-CIMInstance Win32_Process -Filter &amp;#34;ProcessId = &amp;#39;$id&amp;#39;&amp;#34;
 $MemSizeInKB = $ProcessMem.WS/1KB
 $PeakWorkingSetInKB = $Process.PeakWorkingSet/1KB
 $PageCountInKB = $ProcessMem.PrivatePageCount/1KB
 $NonPagedPoolInKB = $ProcessMem.QuotaNonPagedPoolUsage/1KB
 $PagedPoolInKB = $ProcessMem.QuotaPagedPoolUsage/1KB
 
 $TotalMemory = &amp;#34;{0:n3}&amp;#34; -f $TotalMemory
 $MemSizeInKB = &amp;#34;{0:n3}&amp;#34; -f $MemSizeInKB
 $PeakWorkingSetInKB = &amp;#34;{0:n3}&amp;#34; -f $PeakWorkingSetInKB
 $PageCountInKB = &amp;#34;{0:n3}&amp;#34; -f $PageCountInKB
 $NonPagedPoolInKB = &amp;#34;{0:n3}&amp;#34; -f $NonPagedPoolInKB
 $PagedPoolInKB = &amp;#34;{0:n3}&amp;#34; -f $PagedPoolInKB
 
 #write-host &amp;#34;$TotalMemory&amp;#34;
 #write-host &amp;#34;$MemSizeInKB&amp;#34;
 #write-host &amp;#34;$PeakWorkingSetInKB&amp;#34;
 #write-host &amp;#34;$PageCountInKB&amp;#34;
 #write-host &amp;#34;$NonPagedPoolInKB&amp;#34;
 #write-host &amp;#34;$PagedPoolInKB&amp;#34;
 
 # commandline information
 $commandline = (Get-CimInstance Win32_Process -Filter &amp;#34;ProcessId=$id&amp;#34;).CommandLine
 
 $FileName = $filedate+&amp;#34;_memory_usage.txt&amp;#34;
 $FullPath = Join-Path -Path &amp;#34;C:\Users\mvdbo\OneDrive\Documenten\PowerShell&amp;#34; -ChildPath $FileName

 $regel = &amp;#34;$date - pid: $id - cpu: $usage % - mem: $MemSizeInKB KB - pws: $PeakWorkingSetInKB KB - pc: $PageCountInKB KB - pp: $PagedPoolInKB KB - command: $commandline&amp;#34;
 $regel | Out-File -FilePath $FullPath -Encoding utf8 -Append
 
 }

 # Sources
 # https://learn.microsoft.com/en-us/windows/win32/psapi/process-memory-usage-information
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Powershell Clean Memory</title><link>https://19cc27e0.backup-website.pages.dev/en/blog/powershell-clean-memory/</link><pubDate>Mon, 13 Dec 2021 19:12:03 +0100</pubDate><guid>https://19cc27e0.backup-website.pages.dev/en/blog/powershell-clean-memory/</guid><description>&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-html" data-lang="html"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Function Clean-Memory {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Get-PSSession | Remove-PSSession
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; [System.GC]::Collect()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; [GC]::Collect()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; [GC]::WaitForPendingFinalizers()
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Get-Variable |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; #Where-Object { $startupVariables -notcontains $_.Name } |
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ForEach-Object {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; try {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Clear-Variable -Name &amp;#34;$($_.Name)&amp;#34; -Force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Remove-Variable -Name &amp;#34;$($_.Name)&amp;#34; -Force -Scope &amp;#34;global&amp;#34; -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; Remove-Variable -Name &amp;#34;$($_.Name)&amp;#34; -Force -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; #Write-Host &amp;#34;Variable &amp;#39;$($_.Name)&amp;#39; has been cleaned up.&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; catch [Exception] {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; if ($_.Name -notlike &amp;#39;&amp;#39;) { Write-Host &amp;#34;An error has occured. Error Details: $($_.Exception.Message)&amp;#34; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; #Get-Variable
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item></channel></rss>