I was trying to overwrite global policies and I found a way to do it, like this:

  1. Redirect existing global policies in a new XML file:

    pwpolicy -getaccountpolicies > ~/globalPolicies.xml

  2. Edit ~/globalPolicies.xml and remove the first line, "Getting global account policies".

  3. Modify the rules in globalPolicies.xml and save it as ~/globalPolicies.plist

  4. Load it:

    pwpolicy -setaccountpolicies ~/globalPolicies.plist

Even though the above procedure is initially successful, as I can see by checking the policies, when I logout and login back again or restart my computer, the original global policies are restored. The outcome is the same either with sudo or not.

So, what I should do in order for my changes to have a permanent effect?

My computer is a Macbook Pro 2017 with macOS Catalina version 10.15.6.

You must log in to answer this question.

Browse other questions tagged .