FolderRisk: Do not touch
Security C:\Windows\Security
Local security configuration database and logs used by secedit and the Security Configuration and Analysis snap-in.
What it’s for
C:\Windows\security is the workspace of the Security Configuration Engine. The secedit tool compares the current configuration with security templates, analyzes or applies them, and writes the result to %windir%\security\logs\scesrv.log. It is the foundation of the local security policy you edit with secpol.msc.
What it contains
logs\scesrv.log: log created by the system, overwritten each timesecedit /analyze,/configure,/exportor/importruns. Results are grouped by policy type.database: the machine’s security databases (.sdb), includingsecedit.sdb, the local policy database.- Databases you create in the Security Configuration and Analysis snap-in go to
Documents\Security\Databasein your profile, not here.
Risks and best practices
- Do not modify or delete the files in
database: they underpin the application of local policy. Change settings withsecpol.msc,gpedit.mscorsecedit. - After a
secedit /configure, readscesrv.logto find settings that could not be applied. The next command overwrites it, so copy it first. - Export the current configuration before changing it so you can roll back.
- If system permissions are damaged,
secedit /configurewith thedefltbase.inftemplate restores Windows defaults. It is a last resort; test it on a VM first.
Useful commands
# Last lines of the secedit logGet-Content "$env:windir\security\logs\scesrv.log" -Tail 40:: As administrator: export the local security policy to a file (changes nothing)secedit /export /cfg "%TEMP%\secpol-export.inf" /areas SECURITYPOLICY
:: Compare the current configuration with a template (the result goes to scesrv.log)secedit /analyze /db "%TEMP%\analysis.sdb" /cfg "%TEMP%\secpol-export.inf"