Hi @Michael Fringer ,
I did not find a published folder-specific flag list or an exact-descriptor round-trip guarantee for ITaskFolder::SetSecurityDescriptor. Your recorded failure followed folder creation; the setter remains untested in that record.
- Regarding supported setter flags, the folder COM documentation does not enumerate the
LONG flagsvalues. I also checked theITaskFolderdeclaration in Windows SDK10.0.26100.0, intaskschd.h; it declares that parameter without a folder-setter flag enumeration.GetSecurityDescriptor(7)selects owner, group and DACL, which does not make7a setter flag.TASK_DONT_ADD_PRINCIPAL_ACEis documented for the registered-task setter. The RPC specification separately defines task/folder flags, but does not document their mapping to this COM parameter. - Regarding access and execution context,
ITaskService::Connectuses the current token when no user is specified. The RPC specification requires write access to the target. General Windows security-information rules specifyWRITE_DACfor setting a DACL,WRITE_OWNERfor owner/group, andREAD_CONTROLfor reading those components. Owner assignment has additional SID and privilege conditions; for example,SetNamedSecurityInfodocuments owner-token eligibility,SeRestorePrivilege, and the ownership-taking privilege. These general rules do not supply the complete access-check contract for the folder COM setter. Elevation alone does not show that every required right or privilege is present. - Regarding preservation, your readback retains owner
BA, groupBAand the BA-before-SY ACE order, and still containsP. It addsAI, representingSE_DACL_AUTO_INHERITED, and changes the rights tokens fromGAtoFA. See Security Descriptor String Format and ACE Strings. That readback fails your stated exact requirement. It cannot establish a preservation guarantee for future setter/getter calls. - Regarding whether the transformation is mandatory, I found no Task Scheduler documentation requiring this particular
P/GAtoPAI/FAtransformation. The SDDL definitions describe the fields, but do not identify an operation that must introduce these changes. The creation observation alone also cannot identify the internal cause. - Regarding enforcement, I found no documented folder-setter option that guarantees absence of
AI, retention of the original generic masks, and exact preservation of all the other requested fields. The getter protocol describes retrieving security information and encoding it as SDDL, without an exact-input preservation guarantee. The specific documentation gap is therefore both the folder COM flag definition and its preservation limits. A definitive support statement still requires clarification of those two points.
For an attributable clarification, submit these five questions through documentation feedback on the folder setter page or your Microsoft support channel. Include the existing descriptors and an independently verified Windows edition/build. This asks for the missing contract without relaxing your exact-security acceptance check.
If you have any further questions, feel free to ask or leave a comment, and if you found my explanation above was truly helpful or informative to you, I would greatly appreciate it if you could follow this guidance so others with the same issue could benefit as well.
Thank you.