This Perl script can be used for authentication with Active Directory and for connection tracking.
Add the following lines to your server configuration file:
auth-user-pass-verify /path-to/openvpn-super.pl via-env
client-connect /path-to/openvpn-super.pl
client-disconnect /path-to/openvpn-super.pl
/etc/openvpn-super.conf
# The Windows domain to use for Kerberos authentication
domain = example.ca
# The domain controllers to use, in order of preference
dc = dc1.example.ca
dc = dc2.example.ca
# The Active Directory group that the user must be in
group = cn=VPN Users,ou=SomeOU,dc=example,dc=ca
# The mail server to use for sending notifications
mailserver = mail.example.ca
# The recipients for notification messages
mailto = john.smith\@example.ca
mailto = mike\@example.ca
# The log file to use
logfile = /var/log/openvpn.log
openvpn-super.pl see below