2026-04-09

Outlook Mail Deduplicator v1.0

運用 Claude Opus4.6 詠唱出來的小工具

Outlook Mail Deduplicator v1.0.26.04.09.09.45
https://drive.google.com/file/d/1KSnW80APDB8V9o_9SqRBrgL53LOpFtN6

History:
Outlook Mail Deduplicator v1.0.26.04.09.09.06
發布前最後一次修改,Claude 把一個 worker 意外覆蓋掉了,導致按下 [開始掃描] 沒作用

# Outlook Mail Deduplicator 使用手冊

## 一、系統概述

**Outlook Mail Deduplicator** 是一款安全、高效的 Microsoft Outlook 重複郵件檢測與處理工具。

### 核心功能
- **重複檢測**:基於 Message-ID、From、To、Subject、傳送時間等多維度識別重複郵件
- **安全驗證**:顯示重複郵件對比,使用者手動確認保留哪一封
- **智慧處理**:支援三種處理策略(保留最舊/最新/預覽)
- **衝突管理**:對於完全相同的郵件基於使用者選擇處理

---

## 二、系統架構

### 核心模組

#### 2.1 Outlook Profile 管理
- **enumerate_profiles()**:列舉當前系統中所有 Outlook Profile
- **ProfileLoaderThread**:後臺載入 Profile 對應的郵箱帳號

#### 2.2 郵件掃描引擎
- **FolderWalker**:遞迴遍歷所有郵件夾
- **DuplicateEngine**:多維度重複檢測(Message-ID、From、To、Subject、時間容忍)
- **ScanWorker**:後臺掃描執行緒,支援暫停/繼續/取消

#### 2.3 報告生成
- **report_writer.py**:生成 JSON 報告(記錄所有重複群組、衝突、處理結果)
- **CSV 報告**:可選的 Excel 相容格式報告

#### 2.4 衝突處理
- **ConflictDialog**:衝突處理主對話方塊
- **ConflictWorker**:衝突搬移後臺執行緒
- **增量更新**:暫停/取消/進度時自動儲存處理進度

---

2026-03-06

Get VM's Virtual Hard Disk Size with Keyword

$keyword = 'Off'

$vms = Get-VM | Where-Object { $_.Name -like "*$keyword*" }

if (-not $vms) {
   Write-Host "找不到 VM 名稱包含 '$keyword' 的虛擬機。" -ForegroundColor Yellow
   return
}

$vmResults = @()
$grandTotalBytes = 0

foreach ($vm in $vms) {
   $hdds = Get-VMHardDiskDrive -VMName $vm.Name -ErrorAction SilentlyContinue

   if (-not $hdds) {
       $vmResults += [pscustomobject]@{
           VMName     = $vm.Name
           VhdCount    = 0
           TotalSizeGB = 0.0
           Detail     = "<無掛載虛擬硬碟>"
       }
       continue
   }

2026-03-05

在 Windows 下讓 del 有個 alias name: rm

在 Windows 下讓 del 指令有個 alias name: rm

方法:

  • 建立 C:\Windows\System32\rm.cmd
  • 內容:
    @echo off
    del %*
結果: c:\> rm a.txt
等於: c:\> del a.txt

2026-02-03

Open "Find Printers" by Hyperlink



Microsoft Edge

# AutoOpenFileTypes: qds
GPO: Computer Configuration → Administrative Templates → Microsoft Edge → List of file types that should be automatically opened on download
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge\AutoOpenFileTypes" -Force | Out-Null
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge\AutoOpenFileTypes" -Name "1" -Value "qds" -PropertyType String -Force | Out-Null

# AutoOpenAllowedForURLs: 只允許 intranet.contoso.com
GPO: Computer Configuration → Administrative Templates → Microsoft Edge → URLs where AutoOpenFileTypes can apply
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge\AutoOpenAllowedForURLs" -Force | Out-Null
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge\AutoOpenAllowedForURLs" -Name "1" -Value "intranet.contoso.com" -PropertyType String -Force | Out-Null
          Verify: edge://policy


Google Chrome

2026-01-21

Make a Windows 11 Local Account Passwordless

Change this from 2 to 0

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device]
"DevicePasswordLessBuildVersion"=dword:00000000

Create a .reg file with the following:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device]

"DevicePasswordLessBuildVersion"=dword:00000000

Next:

Command: netplwiz
➨ Check: 
Users must enter a user name and password to use this computer

2026-01-08

Deploy Java Deployment Rule Set (Eneterprise White List)

由於 PLM 版本太舊,其中的 Java 程式憑證過期,使用者使用時會彈出警告視窗
所以需要設定企業白名單,而白名單需要進行數位簽章,所以還要有憑證架構

jdk1.8.0_202 Download
https://master.dl.sourceforge.net/project/msi-installers/msi-archive-files/Java/v8u31/jre-8u31-windows-i586.exe

先產生 ruleset.xml
<?xml version="1.0" encoding="UTF-8"?>
<ruleset version="1.0+">
  <rule>
    <id location="https://plmap.contoso.com.tw/"/>
    <action permission="run"/>
  </rule>

  <rule>
    <id location="https://plmifs.contoso.com.tw:8080/"/>
    <action permission="run"/>
  </rule>

  <rule>
    <id/>
    <action permission="default"/>
  </rule>
</ruleset>

2025-12-12

Configure IIS SMTP Service to receive mail over TLS and forward to a non-TLS SMTP service on one Windows Server

Scenario

  1. An older custom SMTP service only accepts unencrypted SMTP connections and does not support TLS.
  2. A solution is required to receive emails over TLS using IIS SMTP Service and relay them to the custom SMTP service without encryption.
  3. The goal must be achieved on a single virtual machine.

Environment Setup

Install two network interfaces on a single Windows Server with the following IP addresses:

  • Network Interface 1: 10.11.11.11 (physical NIC)
  • Network Interface 2: 10.22.22.22 (Description: Microsoft KM-TEST Loopback Adapter)

2025-12-05

批次建立 win-acme 用 DNS Record 取得憑證的任務

批次建立 win-acme 用 DNS Record 取得憑證的任務

$RecordNames = @();
$RecordNames += "www";

$Domain = "contoso.com";

foreach ($RecordName in $RecordNames) {
    
    $FQDN = ($RecordName + '.' + $Domain);
    write-host ('Request Certificate for ' + $FQDN);

在 Azure DNS Zone 用 DNS Record 來驗證 Let's Encrypt 的 PowerShell Script

前情提要: 在 Microsoft DNS Server 上用 DNS Record 來驗證 Let's Encrypt 的 PowerShell Script

AzureDNSZoneVerification.ps1


# -Step "create" -Identifier "{Identifier}" -RecordName "{RecordName}" -Token "{Token}"
# -Step "delete" -Identifier "{Identifier}" -RecordName "{RecordName}" -Token "{Token}"

param (
[string]$Step,
[string]$Identifier,
[string]$RecordName,
[string]$Token
);

[string]$AzureResourceGroupName = "Infra_Network"
[string]$ZoneName = "contoso.com"
[int]$TTL = 3600

write-host ('Step: ' + $Step);
write-host ('Identifier: ' + $Identifier);
write-host ('RecordName: ' + $RecordName);
write-host ('Token: ' + $Token);