3

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 :)

Den1al
  • 617
  • 1
  • 10
  • 16

1 Answers1

1

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.

zihen
  • 261
  • 2
  • 4
  • In CMD it sure does work but on python i need to retrieve this info with just regular permissions... So it's not so helpful... But thanks anyway! – Den1al Aug 24 '13 at 13:24
  • And another question.. How do I manage to achieve just the fields I want in the export log... ? – Den1al Aug 24 '13 at 14:11