Hi there,
I have written a script that creates a new user account in AD and sets the password that you input. The problem is the AD password policy requires the password to be a minimum of 7 characters and have at least one number and one lower and upper case letter in it. It’s easy enough to check the length of the string but how do I check it for upper and lower cases and numbers?
Here’s what I’ve managed so far…
Code:
Function cmdVerifyPassword_Click()
If $txtPassword.Text = ""
$= $Form.MsgBox("The password cannot be empty.", "User password change", 1)
Else
If Len($txtPassword.Text) < 7
$= $Form.MsgBox("The password cannot be less than 7 characters long.", "User password change", 1)
Else
If
; Here's the bit thats missing!
;...
Else
$adsUser.SetPassword($txtPassword.Text)
$= $Form.MsgBox("The password is vallid!")
EndIf
EndIf
EndIf
$txtPassword.Text = ""
$adsUser = Nothing
EndFunction
PS. Using Kixforms.
Thanks in advance,
Glenn 