GPO Backup and Restore
Added in Samba version: 4.10
<What does the feature do, Why might users care about it, What is the Microsoft-equivalent that a Windows admin might be familiar with, etc>
How to configure it
<Just reference the relevant samba-tool/smb.conf options (your man-page/help documentation should already be clear enough)>
Known issues and limitations
<Any outstanding bugs, configurations not supported, etc>
<What debug level do you need to run to see messages of interest. Are there any other ways to verify the feature is doing what it should>
How to test it
make test TESTS=samba_tool.gpo
GPO import and export has a fallback mode to restore from binary files instead of from XML if any errors occur in the restore. Currently there isn't any way to turn this off, and so what should probably fail often doesn't.
Where the code is located
The core parsing logic for GPO is in the python gp_parse module.
The outer logic lives in netcmd/gpo.py (where the actual regex matching used to identify which parser is used) and the tests are all in the samba_tool gpo.py tests.
Note: The parser for PReg .pol files is auto-generated from IDL.
[MS-GPOD] and [MS-GPOD] describe an overview of how the overall Group Policy system works. Individual references to which file formats correspond to which parsers lives in the comments of each parser class in gp_parse.