Skip to main content
Question

Password complexity check EA

  • June 21, 2017
  • 0 replies
  • 4 views

Forum|alt.badge.img+4
  • New Contributor
  • 3 replies

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

0 replies

Be the first to reply!