A while ago I was asking questions about using python to secure windows. This was an answer I recieved. Could someone tell me how someone would do this?

"As an overall way to do it, if you can find out which settings are contained in the registry, it's not difficult to create/write registry keys to which you have access. Other settings, such as GPOs, are harder to do. Sometimes you can change those with Powershell - so you may need to have Python call Powershell to configure some of those settings. If you aren't on a domain and are using local policies, you can configure a master policy file that you have Python replace.

On the whole, if you're looking to configure settings for new devices, a better way to do that would be to create them on a VM and use DISM to snapshot a sysprepped image and then lay it down on a new device. That's the more "Windows-y" way to do it."

  • baldPrussian

My bad, that should have been "folder" not file. There is info about the group policy folders located here. Technet also has a lot of info about how to make local policies using gpedit.msc.

As far as having Python replace a directory, that's also available in Stack Overflow and in the Python documentation. You'd need to run any script that does that as Administrator or System.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.