Tools / Guides / Event ID 7045

Event ID 7045: a new service was installed

What Windows Event ID 7045 means, how to read the service file name, how PsExec and attack tools show up, and how to trace the host that pushed the service.

Updated 2026-11-16 · 7 min read

A detection fires on a file server: Event ID 7045, "A service was installed in the system." Nobody on the change calendar was patching that box today. Servers pick up new services all the time, from agents, drivers and updates, so most of these are dull. The few that aren't are some of the clearest signs of lateral movement you will ever get in a Windows log.

The good news is that a 7045 tells you almost everything you need in one field. Here is how to read it, what PsExec and attack frameworks look like, and how to find the machine that pushed the service.

What does Event ID 7045 mean?

7045 is written to the System log by the Service Control Manager whenever a new service is registered. It is on by default on every Windows version, with no audit policy needed, which makes it one of the few lateral-movement signals you can count on even on a badly configured network.

FieldWhat to look for
Service NameThe name it was registered under. Random strings and names that imitate Windows components stand out.
Service File NameThe command line the service runs. This is the field that decides the verdict.
Service Typeuser mode service or kernel mode driver. New drivers deserve their own look.
Service Start Typedemand start is typical of tools that run once. auto start means it survives a reboot.
Service AccountAlmost always LocalSystem, which is why attackers like services.

The event body has no "installed by" field. Event Viewer's User field on the General tab (the Security UserID in the XML) often holds the SID of the account that created it, but don't rely on it alone. The Security log version, Event ID 4697, records the installing account properly if "Audit Security System Extension" is turned on.

Is Event ID 7045 malicious?

Usually not. Software installs, driver updates, backup agents, EDR upgrades and RMM tools all create services. What separates them from an attack is nearly always the Service File Name. A real product points at a signed binary under C:\Program Files or C:\Windows\System32. An attack points somewhere temporary, or runs a shell directly.

Example of a dull one:

Service Name:      Veeam Agent for Microsoft Windows
Service File Name: "C:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.Service.exe"
Service Start Type: auto start

And one you should not close:

Service Name:      xKqPzTa
Service File Name: %COMSPEC% /b /c start /b /min powershell -nop -w hidden -enc SQBFAFgAIAAoAE4AZQB3AC0A...
Service Start Type: demand start

Treat it as suspicious when the file name contains any of these:

If the command is base64-encoded PowerShell, decode it before deciding anything: our guide on decoding encoded PowerShell walks through it.

How does PsExec show up in Event ID 7045?

Sysinternals PsExec copies PSEXESVC.exe to the target's ADMIN$ share (which is C:\Windows), installs it as a service called PSEXESVC, runs the command and removes the service when it finishes. On the target you get a 7045 with the service name PSEXESVC and a file name of %SystemRoot%\PSEXESVC.exe.

PsExec itself is not malware, and plenty of admins still use it. The question is who ran it, from where, and whether that person normally does. Two things trip people up:

A useful tip: PsExec writes HKCU\Software\Sysinternals\PsExec\EulaAccepted on the machine it was run from. If you find the source host and that key exists under an unexpected user's profile, you have your operator.

How do I find where the service came from?

Remote service installs need a network logon first, so work backwards from the 7045 time on the target:

  1. Event ID 4624, logon type 3, a few seconds before the 7045. Its Source Network Address is the machine that pushed the service and Account Name is who did it. Our Windows logon types guide explains why type 3 is the one to look for.
  2. Event ID 5145 (if detailed file share auditing is on) for access to ADMIN$ and the svcctl named pipe on IPC$. That is the service control call itself.
  3. Process creation (4688 or Sysmon Event ID 1) with services.exe as the parent. Whatever the service started runs under it, so this shows what it actually did.

Then pivot to the source host and repeat: what launched PsExec or the tool there, and how did that account get there in the first place.

Queries to hunt Event ID 7045

On a single machine, PowerShell gives you the fields directly:

Get-WinEvent -FilterHashtable @{LogName='System'; Id=7045} |
  Select-Object TimeCreated,
    @{n='Name';  e={$_.Properties[0].Value}},
    @{n='Path';  e={$_.Properties[1].Value}},
    @{n='Start'; e={$_.Properties[3].Value}},
    @{n='Account'; e={$_.Properties[4].Value}}

In Microsoft Sentinel, System log events land in the Event table:

Event
| where TimeGenerated > ago(7d)
| where EventLog == "System" and EventID == 7045
| where RenderedDescription has_any ("cmd", "COMSPEC", "powershell", "-enc", "ADMIN$", "\\Temp\\", "ProgramData", "PSEXESVC")
| project TimeGenerated, Computer, RenderedDescription
| order by TimeGenerated desc

Expect some hits from installers that wrap a command in cmd /c. After a week, list the noisy ones by name and path rather than dropping the keyword.

FAQ

What is the difference between Event ID 7045 and 4697?

Both record a new service. 7045 is in the System log and is always written. 4697 is in the Security log, needs "Audit Security System Extension" enabled, and records the account that installed the service. Collect both if you can.

Why do I see a 7045 every time someone uses a remote support tool?

Many remote support and RMM tools install a temporary service on each connection, just like PsExec. Build an allow list by service name and file path for the tools you actually use, so a renamed copy still alerts.

Does a deleted service leave a trace?

The 7045 stays in the System log after the service is removed, which is why it is so useful against tools that clean up after themselves. Service Control Manager Event ID 7036 also records the service starting and stopping.

Should I alert on new kernel drivers?

Yes, at a lower volume threshold than services. Attackers load old, vulnerable signed drivers to switch off security tools. A new driver with an unfamiliar name, especially from a user or temp folder, should be checked against the publisher and Microsoft's vulnerable driver blocklist.