TASK_LOGON_S4U is available through the Windows Task Scheduler 2.0 API on Windows 11 Home, but the task must run non-interactively, use only local resources, and already have an effective batch-logon right when Task Scheduler attempts to launch it.
1. S4U support on Windows 11 Home
Microsoft documents TASK_LOGON_S4U as supported by Task Scheduler 2.0 on Windows Vista and later without listing an edition restriction. Therefore, the API applies to Windows 11 Home as well as Pro. An S4U task:
- Stores no account password.
- Runs on a non-interactive desktop.
- Cannot access network resources.
- Cannot access files encrypted with EFS.
- Does not require the user to have an existing interactive session.
TASK_LOGON_INTERACTIVE_TOKENis the separate mode for that scenario. ^1^
The task runs under the specified account’s security context and launches only if that account has Log on as a batch job. ^2^
The documented edition difference concerns policy-management surfaces, not the underlying S4U API: the UserRights Policy CSP lists Pro, Enterprise, Education, and IoT editions, but not Home. Consequently, that CSP cannot be used to manage this right on Home. ^3^
Registration and policy changes require appropriate privileges. A standard account should not be expected to grant itself SeBatchLogonRight; perform registration and any rights assignment from an elevated administrator process.
2. Batch-logon assignment and cleanup
SeBatchLogonRight is required for a batch logon. Rights inherited through group membership count, while SeDenyBatchLogonRight overrides an allow assignment. ^4^
The available Microsoft documentation establishes these points:
- S4U and password-based tasks launch only when the account has the right.
- Task Scheduler logs the account on as a batch user when the task starts.
- Windows provides explicit LSA functions to add and remove account rights. ^5^
It does not establish a general contract that registering or starting an S4U task automatically grants the right. Therefore, do not rely on registration as the grant operation. Check the right before the test and explicitly assign it through an administrator-controlled mechanism if absent.
Likewise, there is no documented guarantee in these sources that deleting a task reverses a user-right assignment. Task deletion and LSA policy modification are separate operations, so record the pre-test policy and explicitly restore it afterward.
Deleting an account also should not be treated as documented policy cleanup. User-right assignments are SID-based; verify the post-test policy for an unresolved SID and remove it explicitly if present.
3. Verify the effective assignment
Run the following from an elevated Command Prompt:
mkdir "%TEMP%\S4UAudit" 2>nul
secedit /export /mergedpolicy ^
/cfg "%TEMP%\S4UAudit\effective.inf" ^
/areas user_rights
findstr /i ^
"SeBatchLogonRight SeDenyBatchLogonRight" ^
"%TEMP%\S4UAudit\effective.inf"
/db is optional. When omitted, secedit /export uses the system security database under %windir%\security\database. /mergedpolicy requests merged domain and local policy, while /areas user_rights limits the export to user logon rights and privileges. ^6^
On a standalone Windows 11 Home machine, there ordinarily is no domain policy to merge, but /mergedpolicy is still the clearer effective-policy audit form.
Interpret the entries as SID lists:
- The account’s SID, or the SID of one of its groups, must appear under
SeBatchLogonRight. - It must not be covered by
SeDenyBatchLogonRight, because deny takes precedence. - Resolve the account SID before deletion so that before-and-after exports can be compared reliably.
For programmatic verification, Microsoft’s direct LSA interfaces are:
-
LsaEnumerateAccountRightsto enumerate rights assigned directly to a particular SID. ^7^ -
LsaEnumerateAccountsWithUserRightto enumerate SIDs directly assigned a specified right. It does not expand rights inherited through group membership. ^8^
4. Account expiration during execution
Account expiration should be treated as blocking the next logon, including the next S4U batch-logon attempt. It is not documented here as a mechanism that revokes an already-created process token or terminates an existing task instance.
Microsoft documents the analogous behavior for a disabled account: an existing session can remain active even though a subsequent sign-in is blocked. ^9^
That source addresses disabled accounts and automatic sign-in, not specifically an expiring local account running an S4U task. Therefore, the exact expiration-boundary behavior should be validated experimentally rather than treated as a documented termination guarantee. Design the test so that:
- The process records its PID, start time, and periodic timestamps locally.
- The account expires while that instance is running.
- The existing PID is observed after expiration.
- A second task launch is attempted and its Task Scheduler result and event log are recorded.
- Cleanup does not depend on account expiration; use an explicit task execution time limit or administrator-controlled termination.
References
- TASK_LOGON_TYPE enumeration (taskschd.h)
- Security Contexts for Tasks
- Policy CSP - UserRights
- Account Rights Constants
- Managing Account Permissions
- secedit /export
- LsaEnumerateAccountRights function (ntsecapi.h)
- LsaEnumerateAccountsWithUserRight function (ntsecapi.h)
- Winlogon Automatic Restart Sign-On (ARSO)