<!-- Configuration file for the "Apex Task Emailer And LDAP Sync Service" service. 
The service e-mails reminders from the Apex database and synchronizes information between the Apex database and LDAP.
To enable LDAP synchronization set _syncLDAP enable="true"_
To use Apex as the master and LDAP as the slave, list fields in the _intrinsicApexFieldToLDAPMaps_ and _customApexFieldToLDAPMaps_ sections.
To use LDAP as the master and Apex as the slave, list fields in the _LDAPtoIntrinsicApexFieldMaps_ and _LDAPtoCustomApexFieldMaps_ sections.
-->

<config>
	<!-- Apex database connection string -->
	<connectionString value="Data Source=.\IHR;Database=IHR;Trusted_Connection=Yes" />

	<!-- Controls if and when reminders will be e-mailed -->
	<sendEmails enable="true" verbose="false" testRouteAllEmailsToRecipient="" smtpServer="127.0.0.1" >
		<runTimes runWhenServiceStarts="true" >
			<runTime value="8:00AM" />
			<runTime value="12:00PM" />
			<runTime value="4:00PM" />
		</runTimes>
	</sendEmails>


	<!-- Configuration for Apex to LDAP synchronization service -->
	<!-- Records can be keyed by SID\SAM Account (keyApexField="SID" keyLDAPField="objectSid") -->
	<!-- For a list of all intrinsic Apex fields that can be synchronized, execute SELECT * FROM dbo.vwEmployeeAll against the Apex database -->
	<syncLDAP LDAPQuery="(objectCategory=User)" 
		enable="false" 
		verbose="true" 
		skipInactiveEmployees="true" 
		keyApexField="Employee Number" 
		keyLDAPField="employeeNumber"
		enableApexDbInserts="true"
		enableLDAPInserts="false" >
		
		<!-- Source is usually set to the root OU for your users and groups. LDAPQuery cannot filter by OU. If you have users in multiple OUs then create a separate source entry for each OU. -->
		<LDAPSources>
			<source path="LDAP://OU=Users,OU=User Accounts and Groups,DC=campus,DC=nevada,DC=edu" />
		</LDAPSources>
		
		<runTimes runWhenServiceStarts="true" >
			<runTime value="3:00AM" />
		</runTimes>

		<!-- Uses Apex as the master and LDAP as the slave. Copies values from dbo.vwEmployeeAll to LDAP -->
		<!-- A given field cannot be a slave and master at the same time. It can only be listed once in either _intrinsicApexFieldToLDAPMaps_ or _LDAPtoIntrinsicApexFieldMaps_ -->
		<intrinsicApexFieldToLDAPMaps>
			<fieldMap sourceApexField="First Name" 		targetLDAPField="givenName" />
			<fieldMap sourceApexField="Last Name" 		targetLDAPField="surname" />
			<fieldMap sourceApexField="Suffix"		targetLDAPField="generationQualifier" />
			<fieldMap sourceApexField="Initials" 		targetLDAPField="initials" />
			<fieldMap sourceApexField="Credentials"		targetLDAPField="description" />
			<fieldMap sourceApexField="Work E-mail"		targetLDAPField="mail" />
			<fieldMap sourceApexField="Home Phone" 		targetLDAPField="homephone" />
			<fieldMap sourceApexField="Title" 		targetLDAPField="personalTitle" />
			<fieldMap sourceApexField="Work Address"	targetLDAPField="streetAddress" />
			<fieldMap sourceApexField="Work Address (cont.)" targetLDAPField="postOfficeBox" />
			<fieldMap sourceApexField="Work City"		targetLDAPField="l" />
			<fieldMap sourceApexField="Work State"		targetLDAPField="st" />
			<fieldMap sourceApexField="Work Zip"		targetLDAPField="postalCode" />
			<fieldMap sourceApexField="Work Phone"		targetLDAPField="telephoneNumber" />
			<fieldMap sourceApexField="Work Fax"		targetLDAPField="facsimileTelephoneNumber" />
			<fieldMap sourceApexField="Mobile Phone"	targetLDAPField="mobile" />
			<fieldMap sourceApexField="Pager"		targetLDAPField="pager" />
		</intrinsicApexFieldToLDAPMaps>

		<!-- Uses Apex as the master and LDAP as the slave. Copies values from custom fields named in dbo.CustomField to LDAP -->
		<!-- A given field cannot be a slave and master at the same time. It can only be listed once in either _customApexFieldToLDAPMaps_ or _LDAPtoIntrinsicApexFieldMaps_ -->
		<customApexFieldToLDAPMaps>
			<fieldMap sourceApexField="IP Phone"		targetLDAPField="ipPhone" />
		</customApexFieldToLDAPMaps>



		<!-- Uses LDAP as the master and Apex as the slave. Copies values from LDAP to dbo.vwEmployeeAll -->
		<!-- A given field cannot be a slave and master at the same time. It can only be listed once in either _intrinsicApexFieldToLDAPMaps_ or _LDAPtoCustomApexFieldMaps_ -->
		<LDAPtoIntrinsicApexFieldMaps>
			<fieldMap targetApexField="First Name" 		sourceLDAPField="givenName" />
			<fieldMap targetApexField="Last Name" 		sourceLDAPField="surname" />
			<fieldMap targetApexField="Suffix"		sourceLDAPField="generationQualifier" />
			<fieldMap targetApexField="Initials" 		sourceLDAPField="initials" />
			<fieldMap targetApexField="Credentials"		sourceLDAPField="description" />
			<fieldMap targetApexField="Work E-mail"		sourceLDAPField="mail"		enableUpdate="false"/> <!-- When enableUpdate is set to false then the service will only copy the field if it created a new Apex employee record. If the Apex employee already exists then the service will not copy the field. -->
			<fieldMap targetApexField="Home Phone" 		sourceLDAPField="homephone" />
			<fieldMap targetApexField="Title" 		sourceLDAPField="personalTitle" />
			<fieldMap targetApexField="Work Address"	sourceLDAPField="streetAddress" />
			<fieldMap targetApexField="Work Address (cont.)" sourceLDAPField="postOfficeBox" />
			<fieldMap targetApexField="Work City"		sourceLDAPField="l" />
			<fieldMap targetApexField="Work State"		sourceLDAPField="st" />
			<fieldMap targetApexField="Work Zip"		sourceLDAPField="postalCode" />
			<fieldMap targetApexField="Work Phone"		sourceLDAPField="telephoneNumber" />
			<fieldMap targetApexField="Work Fax"		sourceLDAPField="facsimileTelephoneNumber" />
			<fieldMap targetApexField="Mobile Phone"	sourceLDAPField="mobile" />
			<fieldMap targetApexField="Pager"		sourceLDAPField="pager" />
		</LDAPtoIntrinsicApexFieldMaps>

		<!-- Uses LDAP as the master and APEX as the slave. Copies values from LDAP to custom fields named in dbo.CustomField -->
		<!-- A given field cannot be a slave and master at the same time. It can only be listed once in either _intrinsicApexFieldToLDAPMaps_ or _LDAPtoCustomApexFieldMaps_ -->
		<LDAPtoCustomApexFieldMaps>
			<fieldMap targetApexField="IP Phone"		sourceLDAPField="ipPhone" />
		</LDAPtoCustomApexFieldMaps>
	</syncLDAP>
</config>
