Posted on
06-20-2017
07:13 PM
- last edited
2 weeks ago
by
kh-richa_mig
I have been using the following to check to see if passwords match complexity with great results up until recently. Now it's coming up fail every time. Any ideas? Thanks!
#!/bin/sh
desiredValue="usingHistory=0 canModifyPasswordforSelf=1 usingExpirationDate=0 usingHardExpirationDate=0 requiresAlpha=1 requiresNumeric=1 minChars=8 maxChars=0 passwordCannotBeName=0 requiresMixedCase=0 requiresSymbol=0 notGuessablePattern=0"
actualValue=`pwpolicy -n /Local/Default -getglobalpolicy`
if [ "$actualValue" == "$desiredValue" ]; then
echo "<result>Pass ($actualValue)</result>"
else
echo "<result>Fail ($actualValue)</result>"
fi