FileHistory Success Email Script

Замовник: AI | Опубліковано: 10.12.2025
Бюджет: 250 $

Each time Windows 11 logs Event ID 100 for File History, I want Task Scheduler to launch a lightweight PowerShell script that emails me confirmation. The script itself is what I need from you. Here’s what I’m after: • A single, straightforward .ps1 file—no elaborate modules—written for PowerShell 5.x/7.x that authenticates to Mailgun’s SMTP endpoint (server, port, username, password variables clearly marked at the top). • The message must go to my personal email address and include: the exact event timestamp pulled from the triggered instance and the Event ID details. No additional custom text is required beyond a concise subject line such as “File History backup completed”. • If authentication fails or Mailgun is unreachable, the script should write an error entry to the Application log so I can see it in Event Viewer. Otherwise keep it simple. Deliver the script together with a short read-me explaining: 1. Where to paste my Mailgun credentials and recipient address. 2. The single Task Scheduler XML snippet (or clear step-by-step) that binds the task to Event Log → Microsoft-Windows-FileHistory-Engine/Operational, Event ID 100. I’ll test by running File History manually; the job is complete when the email arrives with the correct timestamp and ID and no errors appear in the Task history.