I have spent all day looking for an answer but without luck.
I need to be able to disable the Password Complexity in the Local Security Policy on a stand-alone Windows 7 PC.
I have tried scripting with secedit.exe. I have also messed a bit around with C#.
The end result shall be a script/program which will disable the policy and then create a new user account locally.
After some extended research I found out how to do it. Posting the code here in case someone else needs to use it.