Question

I'm making a program in PYTHON that gives some info about the computer, and a part of it is to get info about the Group Policy - Password Policy (The Full path in gpedit.msc is : Local Computer Policy >> Cumputer Configuration >> Windows Settings >> Security Settings >> Account Policy >> Password Policy & Account Lockout Policy.

I need a way to get info about them both in python...

Thanks in advance :)

Was it helpful?

Solution

Run command with administrator:

secedit /export /cfg group-policy.inf /log export.log

In python:

os.system('secedit /export /cfg group-policy.inf /log export.log')

All info will be exported to group-policy.inf file and then parse the file will get the info you want.

See secedit command.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top