Skip to content

PHP script used to check active directory accounts for passwords that will expire and notify them

License

Notifications You must be signed in to change notification settings

ewierschke/ad-password-expire-notify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Active Directory Password Expiration Notifcations

This php script can be used to send users daily email notifications warning them when their password is about to expire.

Setup

Modify the variables in the beginning of the script.

  • scriptPath: Full path to the PHP script parent directory.
  • ldapupn: AD userprincipal name used to bind to AD.
  • ldappass: AD userprincipal name password.
  • ldaphost: AD domain controller.
  • warndays: Number of days to start warning the user.
  • useremailheader: Email header information for end-user notifications.
  • adminemailto: Admin email address to receive summary of notifications.
  • adminemailheader: Email header information for admin notifications.

Edit .tpl files to adjust email format for notifications.

Running

Execute php script with the -o flag to specifiying which OU to search for users with expiring passwords:

When running from CentOS,

  • Postfix configuration is assumed to be working,
  • php and php-ldap packages should be installed.
  • Edit /etc/php.ini to adjust the appropriate date.timezone = value (https://secure.php.net/manual/en/timezones.php) as well as potential to include sendmail arguments for -F (for friendly/full name) and -f (for address of the from person)

Example: /path/to/script/check_expire.php -o "CN=Users, DC=domain, DC=com"

About

PHP script used to check active directory accounts for passwords that will expire and notify them

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 69.2%
  • Smarty 30.8%