Monday, 21 September 2026

Windows Server 2025 16 core Stand

 DISM /online /Set-Edition:ServerStandard /ProductKey:HBNP2-Q32Q2-XQBPR-FK4XX-QV9YB /AcceptEula



Remove the existing generic setup key configuration from the licensing system:

Uninstall the Current Generic Key:
slmgr /upk

Install Your Purchased Retail/MAK Product Key:
slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Force Online Activation:
slmgr /ato


The Permanent Disabler PowerShell Script ( WSUS )

# 1. Stop and Disable the core update services
Stop-Service -Name "wuauserv" -Force -ErrorAction SilentlyContinue
Set-Service -Name "wuauserv" -StartupType Disabled

Stop-Service -Name "UsoSvc" -Force -ErrorAction SilentlyContinue
Set-Service -Name "UsoSvc" -StartupType Disabled

# 2. Stop the Medic service (Requires forcing the Registry as the UI blocks it)
Stop-Service -Name "WaaSMedicSvc" -Force -ErrorAction SilentlyContinue
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" /v Start /t REG_DWORD /d 4 /f

# 3. Disable recovery actions (Prevents Windows from auto-restarting services on failure)
sc.exe failure wuauserv reset= 0 actions= ""
sc.exe failure UsoSvc reset= 0 actions= ""
sc.exe failure WaaSMedicSvc reset= 0 actions= ""

Write-Host "Windows Update Services have been thoroughly disabled." -ForegroundColor Green


The Re-Enable Script (
WSUS)

# 1. Restore service startup types to default configuration
Set-Service -Name "wuauserv" -StartupType Manual
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" /v Start /t REG_DWORD /d 3 /f
Set-Service -Name "UsoSvc" -StartupType Automatic

# 2. Re-enable default service recovery behavior
sc.exe failure wuauserv reset= 86400 actions= restart/60000/restart/120000/restart/60000
sc.exe failure UsoSvc reset= 86400 actions= restart/60000/restart/120000/""
sc.exe failure WaaSMedicSvc reset= 86400 actions= restart/120000/restart/300000/""

# 3. Fire the services back up
Start-Service -Name "wuauserv" -ErrorAction SilentlyContinue
Start-Service -Name "UsoSvc" -ErrorAction SilentlyContinue

Write-Host "Windows Update Services are back to default settings." -ForegroundColor Green


Permanent Fix
Run PowerShell as an Administrator and execute the following complete, aggressive script:
# 1. Take ownership and change Permissions of Windows Update Registry Keys
# This prevents Windows from altering the Start type back to Manual/Automatic
$RegistryPaths = @(
    "HKLM:\SYSTEM\CurrentControlSet\Services\wuauserv",
    "HKLM:\SYSTEM\CurrentControlSet\Services\UsoSvc",
    "HKLM:\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc"
)

foreach ($path in $RegistryPaths) {
    # Force Stop the service first
    $serviceName = Split-Path $path -Leaf
    Stop-Service -Name $serviceName -Force -ErrorAction SilentlyContinue
    
    # Set the Start type to 4 (Disabled) via Registry
    Set-ItemProperty -Path $path -Name "Start" -Value 4 -Force
}

# 2. Disable Scheduled Tasks that trigger self-healing and auto-updates
$TasksToDisable = @(
    "\Microsoft\Windows\WindowsUpdate\Scheduled Start",
    "\Microsoft\Windows\WindowsUpdate\RUXIM\PLUGTASK",
    "\Microsoft\Windows\UpdateOrchestrator\ReportPolicies",
    "\Microsoft\Windows\UpdateOrchestrator\Schedule Scan",
    "\Microsoft\Windows\UpdateOrchestrator\Schedule Scan Static",
    "\Microsoft\Windows\UpdateOrchestrator\UpdateModelTask",
    "\Microsoft\Windows\WaaSMedic\PerformRemediation"
)

foreach ($task in $TasksToDisable) {
    Disable-ScheduledTask -TaskName (Split-Path $task -Leaf) -TaskPath (Split-Path $task) -ErrorAction SilentlyContinue
}

# 3. Block Windows Update Medic Service through Registry Deny Permissions
# This locks the service state permanently
$MedicRegistryPath = "HKLM:\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc"
$acl = Get-Acl $MedicRegistryPath
$arguments = "NT AUTHORITY\SYSTEM", "FullControl", "Deny"
$accessRule = New-Object System.Security.AccessControl.RegistryAccessRule $arguments
$acl.SetAccessRule($accessRule)
Set-Acl $MedicRegistryPath $acl -ErrorAction SilentlyContinue

Write-Host "Windows Update and its background self-healing triggers have been locked." -ForegroundColor Cyan


Thursday, 6 August 2026

Reusable Template Script for Any Windows Server-Ransomware-Protection


# ==============================================================================

# Script: Configure-TallyRansomware-Selvamani.ps1

# Target Data Path: E:\TallyPrimeSelvamani\data

# Target Executable: E:\TallyPrimeSelvamani\tally.exe

# ==============================================================================


# 1. Define Exact Paths

$TallyDataPath = "E:\TallyPrimeSelvamani\data"

$TallyExePath  = "E:\TallyPrimeSelvamani\tally.exe"


$ErrorActionPreference = "Stop"


Write-Host "====================================================" -ForegroundColor Cyan

Write-Host " Configuring Protection & Performance for Tally     " -ForegroundColor Cyan

Write-Host "====================================================" -ForegroundColor Cyan


# 2. Add Data Folder to Ransomware Shield (Protected Folders)

if (Test-Path -Path $TallyDataPath) {

    Write-Host "[+] Adding Protected Data Folder: $TallyDataPath" -ForegroundColor Yellow

    Add-MpPreference -ControlledFolderAccessProtectedFolders $TallyDataPath

    Write-Host "    Successfully added protected folder." -ForegroundColor Green

} else {

    Write-Host "[!] Warning: Folder '$TallyDataPath' not found. Please verify directory name." -ForegroundColor Red

}


# 3. Whitelist tally.exe (Allow Application through CFA)

if (Test-Path -Path $TallyExePath) {

    Write-Host "`n[+] Whitelisting Executable: $TallyExePath" -ForegroundColor Yellow

    Add-MpPreference -ControlledFolderAccessAllowedApplications $TallyExePath

    Write-Host "    Allowed executable successfully." -ForegroundColor Green

} else {

    Write-Host "[!] Warning: Executable '$TallyExePath' not found. If installed elsewhere, adjust path." -ForegroundColor Red

}


# 4. Add Defender Performance Exclusions (Prevents network scanning lag)

Write-Host "`n[+] Adding Performance Exclusions..." -ForegroundColor Yellow

Add-MpPreference -ExclusionProcess "tally.exe"

if (Test-Path -Path $TallyDataPath) {

    Add-MpPreference -ExclusionPath $TallyDataPath

}

Add-MpPreference -ExclusionExtension ".tsf"

Add-MpPreference -ExclusionExtension ".900"

Write-Host "    Performance exclusions configured successfully." -ForegroundColor Green


# 5. Enable Controlled Folder Access (Audit Mode First)

# Options: "AuditMode" (Safe testing) or "Enabled" (Immediate enforcement)

$DesiredMode = "AuditMode" 


Write-Host "`n[+] Setting Controlled Folder Access Mode to: $DesiredMode" -ForegroundColor Yellow

Set-MpPreference -EnableControlledFolderAccess $DesiredMode

Write-Host "    CFA mode updated." -ForegroundColor Green


# 6. Verify Settings

Write-Host "`n====================================================" -ForegroundColor Cyan

Write-Host " Current Controlled Folder Access Summary           " -ForegroundColor Cyan

Write-Host "====================================================" -ForegroundColor Cyan


$mpPrefs = Get-MpPreference


Write-Host "CFA Mode              : " -NoNewline

switch ($mpPrefs.EnableControlledFolderAccess) {

    0 { Write-Host "Disabled (0)" -ForegroundColor Red }

    1 { Write-Host "Enabled / Active Blocking (1)" -ForegroundColor Green }

    2 { Write-Host "Audit Mode Only (2)" -ForegroundColor Yellow }

}


Write-Host "`nProtected Folders:" -ForegroundColor Cyan

$mpPrefs.ControlledFolderAccessProtectedFolders | Where-Object { $_ -like "*Selvamani*" } | ForEach-Object { Write-Host " - $_" -ForegroundColor White }


Write-Host "`nAllowed Applications:" -ForegroundColor Cyan

$mpPrefs.ControlledFolderAccessAllowedApplications | Where-Object { $_ -like "*tally*" } | ForEach-Object { Write-Host " - $_" -ForegroundColor White }


Write-Host "`nConfiguration complete!" -ForegroundColor Green

Wednesday, 29 July 2026

Deleting a Protected Recovery Partition Using DiskPart

 1. Overview

This document outlines the step-by-step procedure for forcefully deleting a protected partition (such as a Recovery partition) on a Windows system using the DiskPart command-line utility.

2. Prerequisites & Safety Warning

[!CAUTION]
Data Loss Risk: The DiskPart tool permanently alters your drive structure. Selecting the wrong disk or partition can lead to irreversible data loss. Double-check all indexes before executing commands.
  • Administrative privileges on the host system are required.
  • Ensure backups of critical data are completed before proceeding.
3. Step-by-Step Execution Profile
diskpart
DISKPART> list disk
DISKPART> select disk 0
DISKPART> list partition
DISKPART> select partition 2
DISKPART> delete partition override

4. Verification & Expected Output
Upon successful execution, the console will output the following confirmation:
DiskPart successfully deleted the selected partition.
The space previously occupied by the deleted partition will now show as Unallocated Space, which can be merged into an adjacent volume or used to create a new partition.





Tuesday, 7 April 2026

AWS Client VPN Endpoint Setup

      Here's the high-level workflow :







➤ First, we generate certificates using EasyRSA.

➤ Then, we upload the server and client certificates AWS Certificate Manager.

➤ Next, we create a Client VPN Endpoint inside our VPC.

➤ After that, we associate it with our private subnet and set authorization rules.

➤ Finally, we connect from our laptop using the AWS VPN Client.

Step 1 - Create VPC & Subnet

➤ Open the VPC Console

➤ Create a VPC with CIDR 10.0.0.0/16

➤ Add a private subnet 10.0.1.0/24

➤ No Internet Gateway needed


Step 2 - Launch Private EC2 Instance

➤ Go to EC2 Console → Launch Instance ➤ Choose Amazon Linux 2 (or Ubuntu)

➤ Place the EC2 inside the private subnet

➤ Do not assign a public IP

➤ Attach a Security Group allowing SSH (port 22), but only from your VPN CIDR later


Step 3 - Generate Certificates

➤ Download EasyRSA from GitHub and extract it. https://github.com/OpenVPN/easy-rsa/releases/download/v3.2.2/EasyRSA-3.2.2-win64.zip

Refer the link - https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/client-auth-mutual-enable.html

➤ Open CMD run as Administrator and enter into the EasyRSA folder

➤ Generates:

- Certificate Authority (CA)

- Server certificate and key

- Client certificate and key

Please download the cert file I created and updated in my own Google Drive, and make use of it.

https://drive.google.com/drive/folders/1O9R4AEktbDU5Ae1HFczbPiPVQolQB1xO?usp=sharing


Step 4 - Upload Certificates to AWS

Go to AWS Management Console →→ Certificate Manager

➤ Upload server certificate (CA, public cert, and private key)

➤ Upload client certificate

➤ Copy the ARN values for later use


Step 5 – Create the Client VPN Endpoint

Go to VPC → Client VPN Endpoints → Create

➤ Select the server certificate ARN

➤ Set client CIDR range, e.g., 10.100.0.0/22

➤ Enable Split-tunnel if desired

After creation :

➤ Add authorization rule to allow VPC CIDR 10.0.0.0/16

➤ Associate VPN Endpoint with private subnet


Step 6 - Download Configuration and Connect

➤ Download the .ovpn configuration file ➤ Embed client certificates inside the file. ➤ Open SSH from EC2 to 10.100.0.0/22

Open AWS VPN Client on your laptop Import configuration and click Connect