No need for UDF complexity, as Shane pointed out. Here's a small enhancement:
 Code:
$Exp = @MaxpWAge-@PWAge			; find # of days before expiration
$Max = 14				; alert when MAX or fewer days left


If $Exp < 0				; never (or already has - probably not possible during login)
  'Your password never expires.' ?	; message probably not needed
Else
  Select
   Case $Exp = 0			; today
    $When = 'today!'
   Case $Exp = 1			; tomorrow
    $When = 'tomorrow!'
   Case $Exp <= $Max			; soon
    $When = 'in ' + $Exp + ' days!'
   Case 1				; much later... no message needed
    $When = ''
 EndSelect

  If $When				; should we display a message at all?
    'Your password expires ' + $When ?
  EndIf
EndIf
Note the minor update to eliminate a message when the password expires more than $Max days away.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D