How to add a administrative template in Group policy with C++?

Issue

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://docs.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?

Solution

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.

Answered By – Y K

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published