Using secedit /export with the user_rights (and optionally securitypolicy) area is a correct way to dump the effective local security policy (including merged GPO settings) as it exists on the machine at the time of export.
Key points based on the secedit behavior in the provided documentation:
-
secedit /exportexports from the local security database-
secedit /export“exports security settings stored in a database configured with security templates.” - If
/dbis not specified, it uses the system security database in%windir%\security\database. - That database reflects the current local security policy after Group Policy processing has updated it.
-
- Using
/areas user_rightsis appropriate for the Se* logon rights- The
user_rightsarea explicitly covers “User logon rights and granting of privileges.” - Therefore,
SeInteractiveLogonRight,SeRemoteInteractiveLogonRight,SeDenyInteractiveLogonRight, andSeDenyRemoteInteractiveLogonRightare included when exporting/areas user_rights.
secedit /export /areas user_rights /cfg C:\undirectorio\gpo.txt - The
-
/areas securitypolicyis optional but valid-
securitypolicycovers “Local policy and domain policy for the system, including account policies, audit policies, security options, and so on.” - It is not required for the four specific Se* logon rights (those are in
user_rights), but exporting it can give a broader view of other security settings.
-
- Effective vs. individual GPOs
-
secedit /exportdoes not export per‑GPO data; it exports what is in the local security database after Group Policy processing. - When multiple GPOs (local + AD GPOs at site/domain/OU) apply, the resulting values written into the local security database are what
secedit /exportshows. That matches the “live” effective policy on the machine.
-
- About
/mergedpolicy-
/mergedpolicyis a switch onsecedit /exportthat “merges and exports domain and local policy security settings.” - When used, it exports the merged view of domain and local policy security settings. It is not limited to “only values that exist in both local and AD policy”; it is intended to output the merged result.
- Example from documentation:
secedit /export /db C:\Security\FY11\SecDbContoso.sdb /mergedpolicy /cfg SecContoso.inf /log C:\Security\FY11\SecAnalysisContosoFY11.log /quiet
-
- Practical guidance
- To capture the effective live settings for the logon rights on a server after all GPOs have applied:
- Ensure Group Policy is refreshed (for example,
gpupdate /forceif needed). - Run
secedit /exportagainst the system database with/areas user_rights(and optionally/mergedpolicyif exporting from a custom DB with/db). - Inspect the resulting
.inf/text file for the Se* entries.
- Ensure Group Policy is refreshed (for example,
- To capture the effective live settings for the logon rights on a server after all GPOs have applied:
Within the documented behavior, this method is appropriate for dumping the effective user-rights assignments as they are applied on the machine.
References: