Well, I guess this thread is as good as any to stop lurking in...

We're running into a similar situation at my office, except our password policy requries 3 of 4 things: uppercase, lowercase, numbers, and "special characters".

I haven't yet managed to tap into AD (much less NDS), but I do have a working complexity checker using KiXforms for a pretty front-end, although it's a bit lengthier than Richard's:

Code:
Break ON

$frmRoot = CreateObject("Kixtart.Form")
If @ERROR
$nul=SetConsole("Show")
"KiXforms.dll not installed/registered" ?
Copy @SCRIPTDIR+"\KiXforms.dll" "%WINDIR%"
If @INWIN = "1"
Shell "%COMSPEC% /c Regsvr32 /s %WINDIR%\KiXforms.dll"
Else
Shell "%COMSPEC% /c %WINDIR%\System\Regsvr32 /s %WINDIR%\KiXforms.dll"
EndIf
$frmRoot = CreateObject("Kixtart.Form")
If @ERROR
"Unable to register KiXforms.dll, please call the helpdesk." ??
"Press ENTER to continue..." ?
Get $S
Exit(1)
EndIf
EndIf

;Create KixForms Password Entry dialog
$System = CreateObject("Kixtart.System")

;KD START

;Intialize Form.
$Form1 = $System.Form()
$Form1.Text = "Password Entry"
$Form1.Height = 285

;Initialize Information Box.
$Label1 = $Form1.Controls.Label()
$Label1.Height = 145
$Label1.Left = 15
$Label1.Text = "Please enter a password for your local account. In order to meet Incredible Technologies' password complexity requirements, it must be at least seven characters long and contain three of the following:" + CHR(10) + CHR(10) + " A) Upper-case letters." + CHR(10) + " B) Lower-case letters." + CHR(10) + " C) Numbers." + CHR(10) + " D) Special characters, such as punctuation marks." + CHR(10) + CHR(10) + "Please enter a password and click 'OK' to continue."
$Label1.Top = 15
$Label1.Width = 259

;Initialize Text Box.
$TextBox1 = $Form1.Controls.TextBox()
$TextBox1.Height = 20
$TextBox1.Left = 90
$TextBox1.Text = ""
$TextBox1.Top = 175
$TextBox1.Width = 100
$TextBox1.PasswordChar = "*"

;Initialize "OK" Button.
$Button1 = $Form1.Controls.Button()
$Button1.Height = 23
$Button1.Left = 105
$Button1.Text = "OK"
$Button1.Top = 210
$Button1.Width = 75
$Button1.OnClick = "Complexity"

;KD END

$Form1.Show
While $Form1.Visible
$=Execute($Form1.DoEvents())
Loop
Exit 1

Function Complexity
;Set Variables.
$string = $TextBox1.Text
$dir = @SCRIPTDIR + "/temp.txt"
$length = Len($string)

;Check to see if password meets length requirements, return to main form if it fails.
If $length < 7
$Form1.Hide
$=$Form1.MsgBox ("Your password does not meet length requirements. Click 'OK' and try again.","Invalid Password")
$Form1.Show
Exit sub
EndIf

;Parse password to ASCII values, sending output to array.
DIM $pwarray[Len($string)]
DIM $pwcheck[Len($string)]
For $chr = 1 To Len($string)
$pwarray[$chr]=ASC(SubSTR($string,$chr,1))
If $pwarray[$chr] > 96 AND $pwarray[$chr] < 123
$pwcheck[$chr] = "Lowercase"
EndIf
If $pwarray[$chr] > 64 AND $pwarray[$chr] < 91
$pwcheck[$chr] = "Uppercase"
EndIf
If $pwarray[$chr] = 32
$pwcheck[$chr] ="Space"
EndIf
If $pwarray[$chr] > 47 AND $pwarray[$chr] < 58
$pwcheck[$chr] ="Number"
EndIf
If $pwarray[$chr] > 32 AND $pwarray[$chr] < 48
$pwcheck[$chr] ="Character"
EndIf
If $pwarray[$chr] > 90 AND $pwarray[$chr] < 97
$pwcheck[$chr] ="Character"
EndIf
If $pwarray[$chr] > 122 AND $pwarray[$chr] < 127
$pwcheck[$chr] ="Character"
EndIf
Next

;Initialize strings to check array for.
$lower = "Lowercase"
$upper = "Uppercase"
$pwarray = "Character"
$num = "Number"

;Check array for existence of types of characters.
$l = isinarray($pwcheck,$lower)
$u = isinarray($pwcheck,$upper)
$c = isinarray($pwcheck,$pwarray)
$n = isinarray($pwcheck,$num)
$test = $l + $u + $c + $n
$test2 = "" + $l + $u + $c + $n

;Generate error codes based on what's in $test2.
If $test2 = "1000"
$err = "Your password only contains lower-case letters. A valid password must also contain two of the following: At least one number, at least one upper-case letter, and at least one special character."
EndIf

If $test2 = "0100"
$err = "Your password only contains upper-case letters. A valid password must also contain two of the following: At least one number, at least one lower-case letter, and at least one special character."
EndIf

If $test2 = "0010"
$err = "Your password only contains special characters. A valid password must also contain two of the following: At least one number, at least one upper-case letter, and at least one lower-case letter."
EndIf

If $test2 = "0001"
$err = "Your password only contains numbers. A valid password must also contain two of the following: At least one special character, at least one upper-case letter, and at least one lower-case letter."
EndIf

If $test2 = "1100"
$err = "Your password must also contain at least one number or one special character."
EndIf

If $test2 = "1010"
$err = "Your password must also contain at least one upper-case letter or one number."
EndIf

If $test2 = "1001"
$err = "Your password must also contain at least one upper-case letter or one special character."
EndIf

If $test2 = "0110"
$err = "Your password must also contain at least one lower-case letter or one number."
EndIf

If $test2 = "0101"
$err = "Your password must also contain at least one lower-case letter or one special character."
EndIf

If $test2 = "0011"
$err = "Your password must also contain at least oen lower-case letter or one upper-case letter."
EndIf

;Verify that password meets complexity requirements, returning to main form if it fails.
If $test < 3
$Form1.Hide
$=$Form1.MsgBox ("The password you entered does not meet complexity requirements. $err Click 'OK' and try again.","Invalid Password")
$Form1.Show
Else
$Form1.Hide
$=$Form1.MsgBox ("The password you entered meets complexity requirements!","Password validated!")
Quit
EndFunction

Function isinarray($array,$string, optional $pos)
DIM $element, $cmd, $vars, $arraydim, $a, $rc, $posvars

$isinarray=0
$pos=Val($pos)

Select
Case VarType($array) & 8192
Select
Case UBound($array,2)=-1
If AScan($array,$string)=-1
$isinarray=0
Return
Else
If $pos
$isinarray=''
For $a=0 To UBound($array)
If $array[$a]=$string
$isinarray=$isinarray+','+$a
EndIf
Next
$isinarray=Split(SubSTR($isinarray,2),',')
If UBound($isinarray)=0
$isinarray=$isinarray[0]
EndIf
Else
$isinarray=1
EndIf
Return
EndIf
Case UBound($array,27)=-1
$arraydim=0
Do
$arraydim=$arraydim+1
Until UBound($array,$arraydim)=-1
$arraydim=$arraydim-1
$vars='$sub_a'
For $a=2 To $arraydim
$vars=$vars+', $sub_'+CHR($a+96)
Next
$cmd='dim '+$vars+@CRLF
$cmd=$cmd+'$isinarray=""'+@CRLF
For $a=1 To $arraydim
$cmd=$cmd+'for $sub_'+CHR($a+96)+'=0 to ubound($array,'+$a+')'+@CRLF
$posvars=$posvars+'+","+$sub_'+CHR($a+96)
Next
$posvars=SubSTR($posvars,6)
$cmd=$cmd+'if $array['+$vars+']=$string'+@CRLF
$cmd=$cmd+'if $pos'+@CRLF
$cmd=$cmd+'$isinarray=$isinarray+chr(13)+'+$posvars+@CRLF
$cmd=$cmd+'else'+@CRLF
$cmd=$cmd+'$isinarray=1'+@CRLF
$cmd=$cmd+'return'+@CRLF
$cmd=$cmd+'endif'+@CRLF
$cmd=$cmd+'endif'+@CRLF
For $a=1 To $arraydim
$cmd=$cmd+'next'+@CRLF
Next
$cmd=$cmd+'$isinarray=split(substr($isinarray,1),chr(13))'+@CRLF
$cmd=$cmd+'if ubound($isinarray)=0'+@CRLF
$cmd=$cmd+'$isinarray=$isinarray[0]'+@CRLF
$cmd=$cmd+'endif'+@CRLF
$rc=Execute($cmd)
Case 1
$isinarray=0
EndSelect
Case $string=''
$isinarray=0
Case $string=$array
$isinarray=1
Case 1
$isinarray=0
EndSelect
EndFunction



--Eriq.