Every Windows server keeps a running record of what happens on it: who signed in, who failed to, which services were installed, when it restarted and what crashed. These records are the Windows event logs. They cost nothing, they are already switched on, and when something goes wrong they are the first place an investigator looks. Most small offices never open them.
This guide explains which logs matter, the handful of event IDs worth knowing, what the logs do not record by default, and how long you need to keep them under Indian rules.
Where the logs live
Open Event Viewer on the server (press Windows+R, type eventvwr.msc, press Enter) and expand Windows Logs. Three of the logs there do most of the work:
- Security: sign-ins, failed sign-ins, account and group changes, and policy changes. This is the log that matters most for spotting an attack. By default only administrators, and members of the Event Log Readers group, can read it.
- System: messages from Windows itself, such as services being installed, started or stopped, restarts and shutdowns, and driver or disk errors.
- Application: messages from programs, such as crashes, database errors and Windows Installer (MSI) installations.
Further down, under Applications and Services Logs, are more specialised logs, for example Remote Desktop session logs, Microsoft Defender Antivirus and PowerShell. PowerShell script block logging writes there once you switch it on.
The event IDs worth knowing
Every entry has a number, the event ID. You do not need to memorise hundreds. These are the ones that come up again and again in security work:
| Event ID | Log | What it means |
|---|---|---|
| 4624 | Security | Successful sign-in. Logon type 10 means Remote Desktop. |
| 4625 | Security | Failed sign-in. Many of these in a row usually means password guessing. |
| 4672 | Security | An account with administrator-level rights signed in. It appears on every such sign-in, so it is normal to see it often. |
| 4720 | Security | A new user account was created. |
| 4732 | Security | Someone was added to a local group, such as Administrators. |
| 4740 | Security | An account was locked out after too many wrong passwords. |
| 1102 | Security | The Security log was cleared. Rarely innocent. |
| 7045 | System | A new service was installed. |
| 104 | System | An event log (for example System) was cleared. |
| 11707 / 1033 | Application | Windows Installer finished installing a product (MsiInstaller). |
For a closer look at failed sign-ins, including the status codes that tell you why each one failed, read Event ID 4625 explained.
You can pull these out without scrolling through Event Viewer. For example, this lists failed sign-ins from the last 24 hours (run PowerShell as administrator):
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625; StartTime=(Get-Date).AddDays(-1)} -ErrorAction SilentlyContinue | Select-Object -First 20 TimeCreated, Id, Message
The -ErrorAction SilentlyContinue part stops PowerShell printing an error when there are no matching events, which is the result you are hoping for.
What the logs can show you
- Password guessing. Runs of 4625 from the same address, or against the same account, are the footprint of a brute-force attack.
- Sign-ins that should not happen. A 4624 with logon type 10 at 2 a.m. on a Sunday deserves a question, even if the account is a real one. See after-hours login monitoring.
- An attacker settling in. New accounts (4720), new members of Administrators (4732), new services (7045) and a cleared log (1102 or 104) are classic signs that someone is making themselves at home. Our list of signs your server may have been compromised goes through them one by one.
What the logs do not record by default
It is easy to assume the logs capture everything. They do not, and it matters when you are deciding what you can prove later.
- Who opened which file. Windows does not record file reads or changes unless “Audit File System” (or “Audit File Share”) is switched on and the folders themselves are marked for auditing. Both are off by default, and Microsoft’s audit policy recommendations leave them off for most servers. So if a staff member copies client files they are allowed to open, the default logs will show that they signed in, not what they read. If you need this for one sensitive folder, such as the Tally data folder, your IT person can set it up, but expect a lot of entries.
- Every software install. Programs installed from an MSI package leave a record in the Application log. Many programs that install from an .exe leave none. A new service (7045) is often the only trace.
- Some security events. Several useful categories, such as firewall rule changes and scheduled-task creation, are only logged when the matching audit setting is on. Our recommended Windows audit policy is a copy-paste baseline that turns on the firewall-rule and new-service events; scheduled-task auditing (“Audit Other Object Access Events”) is a separate switch your IT person can add.
How long to keep them: CERT-In’s 180 days
CERT-In’s Directions of 28 April 2022 apply to service providers, intermediaries, data centres, body corporates and government organisations, and CERT-In’s FAQ treats a firm as a body corporate. They require the logs of all ICT systems to be kept for a rolling 180 days, stored within India, and handed to CERT-In when it asks. The same Directions require cyber incidents to be reported to CERT-In within six hours of noticing them. This is a summary, not legal advice.
Out of the box, Windows will not keep 180 days. Each log has a size cap and, once full, overwrites its oldest entries. On a server that faces a lot of failed sign-ins, the Security log can roll over in days. Check what you have now:
Get-WinEvent -ListLog Security, System, Application | Format-Table LogName, MaximumSizeInBytes, RecordCount, LogMode
(Get-WinEvent -LogName Security -Oldest -MaxEvents 1).TimeCreated
The second line shows the date of the oldest entry still in the Security log. If it is only a few weeks back, ask your IT person to raise the size (for example to 1 GB with wevtutil sl Security /ms:1073741824) and to set up a regular export of the logs to storage inside India, so older entries are kept after they roll off the server.
Why nobody reads them, and what to do about it
A busy server writes thousands of entries a day, most of them routine. Nobody in a ten-person office is going to read them, and a part-time IT vendor will usually only look after something has already gone wrong. That is why the logs are more useful when something reads them for you and only speaks up when an entry matters.
Prixl Warden does that job on the server. It watches the Windows event logs for failed and successful sign-ins, password-guessing patterns (both fast floods and slow, low-and-slow campaigns), sign-ins outside your working hours, admin sign-ins, new accounts and admin-group changes, account lockouts, new services and scheduled tasks, a cleared audit log, audit policy changes, and the firewall being switched off or its rules changed. Serious events are emailed straight away with a plain-English explanation, and a daily digest arrives at 18:00 IST. Warden keeps the events it collects for 30 days, stored in AWS Mumbai. That helps, but it is not a copy of every Windows log, so keep the server’s own logs as described above.
If you would rather have alerts than a log viewer, Warden can send them. Start your 30-day free trial.
