I'm on Windows. Adding a administrative template in Group policy is easy, you just go to the gpo where you want to add the template, then right click, add template. I want to do this with C++, I looked at msdn and I only discovered functions where I can add a new gpo, but I couldn't find a function to add a template.
These are the functions: https://learn.microsoft.com/en-us/windows/win32/api/gpedit/nn-gpedit-igrouppolicyobject How can I add an administrative template to Group policy with C++? Maybe I can do it with the registry?
I solved it a long time ago. The only thing the registry does is this: creating/deleting keys. When you use LGPO it actually creates those keys. You can manage registry keys using Windows API.
You can also track the changes in the registry using a software or just simply pressing ctrl + f to search for those keys so you can create them in your program.