Event 4697 is written when a new service is installed on the system. It comes from the Audit Security System Extension subcategory, and Microsoft lists Windows Server 2016 and Windows 10 as the minimum operating systems. That one detail explains a common complaint: on older servers there is no 4697 to find. The other record of the same moment is event 7045, written to the System log by the Service Control Manager. People compare the two constantly, and in our Search Console data the queries "event id 4697 vs 7045" and "event id 7045 vs 4697" both show up.
For investigations, the difference is the Subject block. 4697 names the account that performed the installation, with SubjectUserSid, SubjectUserName, SubjectDomainName and SubjectLogonId. The logon ID takes you to the 4624 for that session, so you can see whether the install came from a console, a remote desktop or a network logon. It also lives in the Security log, which is usually protected and forwarded more strictly than the System log. When both logs are collected, treat the pair as a cross-check: one without the other points to a collection gap or to log tampering.
The service fields are precise. ServiceName is the name. ServiceFileName is the fully rooted path the Service Control Manager will execute, including any command-line parameters, so a service wired to cmd.exe /c or PowerShell shows its arguments right there. Microsoft warns that it records the path at creation only; if the path is changed afterwards, nothing is logged, and you have to track the change through process creation events. ServiceType is a hexadecimal value: 0x1 kernel driver, 0x2 file system driver, 0x8 recognizer driver, 0x10 Win32 own process (the common case), 0x20 Win32 share process, and 0x110 and 0x120 for the interactive variants. ServiceStartType runs from 0 (boot) and 1 (system), both for drivers, through 2 (automatic) and 3 (manual) to 4 (disabled). ServiceAccount is populated only for Win32 own and share process services, and LocalSystem is used when none is supplied. A later account change is not logged either.
Microsoft turns those fields into five rules, and they are a good detection starting point. Report every service whose file name is not under %windir% or the Program Files folders. Report service types 0x1, 0x2 and 0x8, which start first and get almost unlimited access to the operating system. Report start types 0 and 1, which only drivers use. Report start type 4, since installing a service already disabled is unusual. And report any service account other than localSystem, localService or networkService, because that identifies services running under a user account.
The sample deliberately shows where those rules stop. It continues the PsExec example used for event 5145: adm.lopez, under the same logon session 0x5d21b8, installs PSEXESVC with a Win32 own process type, manual start and LocalSystem. The binary lives in %SystemRoot%, because PsExec-style tools copy it through ADMIN$, which maps to the Windows folder. Rule one never fires on it. What gives it away is context: a remote installation under a network logon from a workstation address, a service name that does not belong to any software you deploy, and a 5145 write to ADMIN$ a few seconds earlier. MITRE tracks the persistence side as T1543.003 (Windows Service) and the execution side as T1569.002 (Service Execution).
Services get created three ways: sc.exe or the PowerShell New-Service cmdlet on the host, the Service Control Manager API from a program, and remotely through RPC. The remote route reaches the target over the svcctl named pipe on IPC$, which is the RelativeTargetName you will see in a 5145 for that pipe moments before the 4697. So a 5145 with svcctl followed by a 4697 under the same network logon is a remote installation almost by definition, and the Subject tells you which account was used to do it.
Build the chain: the 4624 type 3 logon, the 5145 write of the binary, this 4697, and then a 4688 for the process the service launched. Each step has its own field set, and the logon ID is the thread that ties them together on the target host.