This snippet is part of a larger programme used to synchronized new users created in LDAP with Active Directory. One of the issues I came across was with creating Exchange users. It turns out that there are only a few attributes that need be be altered to create those accounts. After binding to your AD server, you issue this code to create the users.
Neil
$ldap->modify($dn, add => [ homeMDB => 'CN=Mailbox Store (DOMAIN),CN=First Storage Group,CN=InformationStore,CN=DOMAIN,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=DOMAIN,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=DOMAIN,DC=com,DC=au']); $ldap->modify($dn, add => [ mDBUseDefaults => 'TRUE']); $ldap->modify($dn, add => [ msExchHomeServerName => '/o=DOMAIN/ou=Firs +t Administrative Group/cn=Configuration/cn=Servers/cn=DOMAIN']); $ldap->modify($dn, add => [ mail => email address ]); $ldap->modify($dn, add => [ mailnickname => Nickname ]); $ldap->modify($dn, add => [ targetaddress => "SMTP:email address" ]);