Windows Server Setup Script

OpenVPN Windows Server
All-in-One Manager

A complete, menu-driven PowerShell script that handles everything: install OpenVPN, generate certificates, add/revoke clients, configure NAT, and monitor your server — all from one script.

MIT License • v1.0.0 • Works on Windows Server 2019, 2022, Windows 10/11

⚡ Quick Start

1

Download the Script

Run this one-liner in PowerShell (as Administrator) to download directly:

Invoke-WebRequest -Uri "https://zeonedge.com/scripts/openvpn_windows_manager.ps1" -OutFile "openvpn_windows_manager.ps1"

Or download from vpn.zeonedge.com:

Invoke-WebRequest -Uri "https://vpn.zeonedge.com/scripts/openvpn_windows_manager.ps1" -OutFile "openvpn_windows_manager.ps1"
2

Run the Script

Open PowerShell as Administrator and run:

powershell -ExecutionPolicy Bypass -File openvpn_windows_manager.ps1

Or if you're already in PowerShell:

Set-ExecutionPolicy Bypass -Scope Process -Force; .\openvpn_windows_manager.ps1
3

Follow the Interactive Menu

The script will guide you through:

  • Setting your public IP, port, and protocol
  • Choosing DNS servers (Google, Cloudflare, OpenDNS, etc.)
  • Configuring VPN subnet and NAT
  • Creating your first client profile (.ovpn)
4

Connect Your Clients

Copy the generated .ovpn file from C:\Program Files\OpenVPN\clients\ to your devices and import into OpenVPN Connect.

🛠 What the Script Does

📦

Full Installation

Downloads & installs OpenVPN, EasyRSA, generates CA, server certs, DH params, and TLS keys

🧙

Interactive Setup

Asks for public IP, port, protocol, DNS, subnet, routes, NAT — no manual config editing

👥

Client Management

Add single clients or batch create (e.g., agent1–agent10). Self-contained .ovpn profiles

🚫

Client Revocation

Revoke any client certificate and automatically regenerate CRL

🌐

NAT Configuration

VPN clients get internet access through the server's IP address

📊

Status Dashboard

View service status, connected clients, port listening, NAT rules, and recent logs

🔄

Profile Regeneration

Changed server IP or port? Regenerate all client .ovpn profiles at once

🧹

Clean Removal

Remove all config, certs, and profiles — keeps OpenVPN software installed

📋 Script Menus

First Run (Not Configured)

╔══════════════════════════════════════╗

║ ZeonEdge OpenVPN Manager v1.0 ║

╚══════════════════════════════════════╝

OpenVPN is not yet configured.

1) Install & Configure OpenVPN

2) Exit

After Installation

╔══════════════════════════════════════╗

║ ZeonEdge OpenVPN Manager v1.0 ║

╚══════════════════════════════════════╝

1) Add a new client

2) Add batch clients

3) Revoke a client

4) Server status dashboard

5) Regenerate all profiles

6) Remove OpenVPN config

7) Exit

🚀 One-Liner Install

Download and run in a single command (PowerShell as Admin):

Invoke-WebRequest -Uri "https://zeonedge.com/scripts/openvpn_windows_manager.ps1" -OutFile "$env:TEMP\openvpn_windows_manager.ps1"; powershell -ExecutionPolicy Bypass -File "$env:TEMP\openvpn_windows_manager.ps1"

⚠️ Prerequisites

  • • Windows Server 2019/2022 or Windows 10/11
  • • PowerShell 5.1 or later (pre-installed on modern Windows)
  • • Administrator privileges
  • • Internet access (to download OpenVPN and EasyRSA)
  • • Open the VPN port (default: 1194/UDP) in your cloud provider's firewall / security group

📖 Full Setup Guide

Read the complete step-by-step tutorial with screenshots and troubleshooting on our blog:

Read the Full Guide