Hi All,
I'm hoping to save a few of your foreheads and keyboards by letting you know some of the most common and useful commands in the pwpolicy command line utility have been deprecated.
If you look at the man page for pwpolicy in 10.9, the first six commands, which are also the most commonly used, look like this:
-getglobalpolicy Get global policies
-setglobalpolicy Set global policies
-getpolicy Get policies for a user
--get-effective-policy Gets the combination of global and user
policies that apply to the user.
-setpolicy Set policies for a user
-setpolicyglobal Set a user account to use global policies
The man page in 10.10, however, looks like this:
-getglobalpolicy Get global policies. DEPRECATED.
-setglobalpolicy Set global policies. DEPRECATED.
-getpolicy Get policies for a user. DEPRECATED.
--get-effective-policy Gets the combination of global and user
policies that apply to the user. DEPRECATED.
-setpolicy Set policies for a user. DEPRECATED.
The command "-setpolicyglobal" isn't even listed in the new man page.
I discovered this when we had a 10.10 machine that had had a configuration profile applied, which included a password expiration policy. The configuration profile was subsequently removed, but the password policy was still active - of which we were unaware until later, when the user unexpectedly started getting a pending password expiration notice upon login.
Using the instructions in an article on Krypted.com (http://krypted.com/mac-security/programatically-setting-password-policies/) (Hi Charles!) I tried to manipulate the pwpolicy options to get the prompt to disappear - to no avail. Long story short, once I brought up the man page for pwpolicy in 10.10, rather than 10.9, I immediately saw the issue.
Armed with this new info, I was able to use the -clearaccountpolicies command via pwpolicy to remove the password expiration, both globally and user-specific.
None of the deprecated commands returned errors, BTW. They all appeared to work in the Terminal. In fact, when I ran --get-effective-policies, data was returned and there was no indication that I was working with outdated commands.
Hope this helps.
-PEM