- Session control is checked against the security descriptor ETW keeps per
- provider GUID under `HKLM\SYSTEM\CurrentControlSet\Control\WMI\Security`, whose
- default grants those rights to SYSTEM, Administrators, the service accounts and
- `BUILTIN\Performance Log Users` — and to nobody else. So the elevated half puts
- the account named by `-TraceUser` into that group, and the command above then
- works unelevated; enabling another account later is just
- `net localgroup "Performance Log Users" <user> /add`. Membership is read into
- the access token **at logon**, so sign out and back in first — any new logon
- does it, and an `ssh` login into the box is the quick way to check without
- dropping the desktop.
-
- **Kernel traces are not available this way, and cannot be made to be.**
- `xperf -on base` and `wpr -start` drive the *NT Kernel Logger*, which is
- reserved for Administrators and LocalSystem — Microsoft documents Performance
- Log Users access as explicitly not extending to it. That was measured rather
- than assumed, and the negative result is recorded here so nobody repeats the
- experiment: with the account in the group, `SeSystemProfilePrivilege` ("Profile
- system performance") granted to that group, and an explicit ACE giving the
- group `TRACELOG_ACCESS_KERNEL_LOGGER` on `SystemTraceControlGuid` — all three
- in place, across a reboot — `xperf -on base` still answered `NT Kernel Logger:
- Access is denied. (0x5)`. It is not a check an ACE overrides. The privilege
- grant and the ACE were dropped again rather than left on the box earning
- nothing: CPU sampling and whole-system traces are elevated work, with `xperf`,
- `wpr` or VTune from an Administrator prompt.
-
- Analysis was never affected — `wpa.exe` opens an existing `.etl` as a plain
- user. This is only about collection.
-
- The step runs **first** in the elevated half, and `-EtwRightsOnly` runs it and
- nothing else, which matters because a full run is dominated by the three Visual
- Studio passes that take minutes even with nothing to do:
+ It is not a check an ACE overrides, and the same wall turned up often enough
+ elsewhere that the whole approach was dropped rather than carried as a
+ half-working path. **Sign in to an administrator account and run `xperf`, `wpr`
+ and VTune from an elevated prompt.** Analysis is the exception and never needed
+ any of this: `wpa.exe` opens an existing `.etl` as a plain user.
+
+ If an earlier revision of these scripts ran on a box, it left that account in
+ the group. Take it back out with: