DISM /online /Set-Edition:ServerStandard /ProductKey:HBNP2-Q32Q2-XQBPR-FK4XX-QV9YB /AcceptEula
Remove the existing generic setup key configuration from the licensing system:
The Re-Enable Script (WSUS)
DISM /online /Set-Edition:ServerStandard /ProductKey:HBNP2-Q32Q2-XQBPR-FK4XX-QV9YB /AcceptEula
# ==============================================================================
# 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
1. Overview
DiskPart command-line utility.2. Prerequisites & Safety Warning
[!CAUTION]
Data Loss Risk: TheDiskParttool permanently alters your drive structure. Selecting the wrong disk or partition can lead to irreversible data loss. Double-check all indexes before executing commands.
DiskPart successfully deleted the selected partition. 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