Windows PowerShell monitoring scripts that send alerts and reports through Telegram.
- Login and failed-login alerts
- Event log tamper alerts
- Process launch and file access monitoring
- CPU, memory, disk, and network health checks
- Network adapter, IP, and VPN change detection
- Telegram command centre for status, screenshots, file movement, clipboard, launching apps, typing text, and power actions
- Telegram file inbox for sending files from phone to PC
- Activity history shared across alerts, reports, and remote commands
- Optional camera snapshots and microphone recordings when
ffmpegand device names are configured - Daily and weekly summary reports
- Open Telegram and search for
BotFather. - Send
/newbot. - Save the bot token.
- Open Telegram and search for
userinfobot. - Press Start.
- Save the chat ID it returns.
Copy-Item config.example.json config.json
notepad config.jsonUse values like:
{
"botToken": "YOUR_BOT_TOKEN_HERE",
"chatID": "YOUR_CHAT_ID_HERE",
"cpuThreshold": 90,
"memoryThreshold": 90,
"diskThreshold": 90,
"installPath": "C:\\path\\to\\Remote PC Monitor",
"cameraDeviceName": "Integrated Camera",
"microphoneDeviceName": "Microphone Array (Realtek(R) Audio)"
}Users should not edit the task XML files manually. installPath is the single path source, and setup_tasks.ps1 rewrites the XML files locally for each machine.
setup_tasks.ps1 configures the required audit policies automatically.
If you ever need to do it manually, run PowerShell as Administrator:
auditpol /set /subcategory:"Logon" /success:enable /failure:enable
auditpol /set /subcategory:"Process Creation" /success:enable
auditpol /set /subcategory:"Other Logon/Logoff Events" /success:enable /failure:enableOptional:
auditpol /set /subcategory:"File System" /success:enableRun this once in the project folder:
powershell.exe -ExecutionPolicy Bypass -File ".\setup_tasks.ps1"This will:
- Show the Raven banner and request elevation automatically
- Detect and persist
installPath - Validate your Telegram bot token
- Install
ffmpegautomatically if it is missing - Enable the required Windows audit policies
- Refresh all task XML files with the current script path
- Install all six scheduled tasks under
SYSTEM
The committed XML files in tasks/ are templates. They intentionally ship with placeholder paths so forks and downloaded copies stay portable.
Start the bot listener manually:
powershell.exe -ExecutionPolicy Bypass -File ".\bot_commands.ps1"Then send these commands in Telegram:
/start/status/screenshot/processes/ls downloads/pull downloads\example.txt/setclipboard hello from phone/routine snapshot
Send a Telegram document directly to the bot to store it on the PC inbox. Add caption /save documents to place it in a specific folder alias.
Remote PC Monitor/
|-- bot_commands.ps1
|-- daily_report.ps1
|-- event_monitor.ps1
|-- install_tasks.ps1
|-- network_monitor.ps1
|-- pc_monitor_common.ps1
|-- performance_monitor.ps1
|-- setup_tasks.ps1
|-- config.example.json
|-- config.json
|-- tasks/
| |-- BotCommandsTask.xml
| |-- DailyReportTask.xml
| |-- EventMonitorTask.xml
| |-- NetworkMonitorTask.xml
| |-- PerformanceMonitorTask.xml
| `-- WeeklyReportTask.xml
|-- README.md
`-- LICENSE
event_monitor.ps1: Handles monitored Windows events and sends alerts.performance_monitor.ps1: Checks CPU, memory, disk, and connectivity thresholds.network_monitor.ps1: Detects adapter, IP, and VPN changes.daily_report.ps1: Sends daily or weekly summary reports.bot_commands.ps1: Polls Telegram for remote commands.data/incoming: Files received from Telegram.data/logs/activity.log: Unified command/alert/report history.pc_monitor_common.ps1: Shared config, Telegram, task, and installer helpers.
Event MonitorPerformance MonitorNetwork MonitorDaily ReportWeekly ReportBot Commands
For GitHub users and forks, the supported setup flow is:
- Clone or download the repository
- Copy
config.example.jsontoconfig.json - Fill in
botTokenandchatID - Leave
installPathas the placeholder or set it explicitly - Run
setup_tasks.ps1and approve the Administrator prompt
Do not manually edit the XML files in tasks/. setup_tasks.ps1 localizes them automatically for the current machine.
- Verify
config.jsonhas the right bot token and chat ID. - Run
taskschd.mscand confirm thePC Monitortasks exist. - Confirm the
LogonandOther Logon/Logoff Eventsaudit subcategories are enabled. - Run a script manually with
powershell.exe -ExecutionPolicy Bypass -File ".\script_name.ps1".
- Start
bot_commands.ps1manually. - Send
/start. - Confirm the machine can reach
api.telegram.org.
- Re-run
setup_tasks.ps1and approve the UAC prompt. - If
wingetis unavailable, install the Microsoft App Installer package and try again. - Review the terminal output for the failing task name.
- Protect
config.json. - Rotate the Telegram bot token if it is exposed.
- Review remote commands before using shutdown or restart actions.
- Added multi-event monitoring
- Added Telegram bot commands
- Added performance monitoring
- Added network monitoring
- Added daily and weekly reports
- Removed legacy and duplicate installer scripts
- Consolidated shared logic into
pc_monitor_common.ps1
- Basic login monitoring