Appendix E: Customizing Overrides
In SMART Directory Sync, an override is used to transform values in the target directory based upon a formula.
The formula language used is T-SQL, used in Microsoft’s SQL Server product line. A valid select statement in T-SQL would be Select (FirstName + LastName) from BT_Person. When adding an override you do not need to include a full
SQL select statement as portions of the SQL statement are generated for you. Specifically, you are not required to use the select or from commands in the override. It is only required to enter the columns that should be selected. To continue the example above, a valid override would only need to contain the value of FirstName + LastName.
To add a View Override:
1. From the Mapping tab, click Overrides. The View Overrides window appears.
2. Click Add. The Override dialog appears.
3. Select a Person or Groups from the View drop-down list.
4. Enter a Field Name for the new override. This must be a valid internal field name in SQL.
5. Enter a Field Value for the new override. This must be a correctly formatted SQL statement.
6. Enter Comments for the new override.
7. Click Save.
SMART DIRECTORY SYNC 4.3.0.1 COMPREHENSIVE USER GUIDE FOR AD
MIGRATION/SYNCHRONIZATION AND EXCHANGE MIGRATION
82
8. Click Yes for the confirmation message.
When you save an override, SMART Directory Sync re-generates the Person or Groups view. It does this by dynamically generating a single SQL statement using the snippet of SQL code that is part of all overrides. The max size for this SQL statement is 8000 total characters. If many new overrides are added, this limit could be exceeded and an error when adding the overrides will occur. In addition to the default overrides, approximately 15-20 more Person and 20-25 Group overrides can be added before hitting the size limit.
To edit a mapping override:
1. From the Mapping tab, click Overrides. The View Overrides window appears.
2. Select an Override and click Edit. The Override dialog appears.
3. Edit the Field Value for the override. The View and Field Name cannot be edited.
4. Edit Comments for the override.
5. Click Save.
6. Click Yes for the confirmation message.
SMART DIRECTORY SYNC 4.3.0.1 COMPREHENSIVE USER GUIDE FOR AD
MIGRATION/SYNCHRONIZATION AND EXCHANGE MIGRATION
83
To delete a mapping override:
1. From the Mapping tab, click Overrides. The View Overrides window appears.
2. Select an Override and click Delete.
3. Click Yes for the confirmation message.
Controlling actions with Overrides
SMART Directory Sync uses the TypeOfTransaction column from the BT_Person table, or the Operation column from the BT_Groups table to determine what action to perform on the target object. These may have overrides applied to them, to control what actions Directory Sync will take for an object. The below image shows an example of this kind of override.
Matching user accounts with Overrides
The values used for matching can have overrides applied to them. This is accomplished by setting up a new override using the field names MatchValue1, MatchValue2, MatchValue3 and MatchValue4. Each MatchValue1-4 corresponds the respective Source and Target pair on the matching tab.
These values are used for matching only. Values that get written to the target are based on the mappings, not the matching.
SMART DIRECTORY SYNC 4.3.0.1 COMPREHENSIVE USER GUIDE FOR AD
MIGRATION/SYNCHRONIZATION AND EXCHANGE MIGRATION
84
Example Overrides
Field Name Field Value
'@domino.contoso.com' ELSE 'SMTP:' +
TargetAddress CASE EntryType WHEN 'user' THEN 'SMTP:' + P.BTCustom020 + dbo.ReplaceDomain(InternetAddress,'domino.contoso.com') END
TargetAddress 'SMTP:' + dbo.UpdateInternetAddress(InternetAddress,'domino.')
TargetAddress ' 'SMTP:' + dbo.ReplaceDomain(InternetAddress,'domino.contoso.com')
Description
This formula will dynamically set the targetaddress value based on the
EntryType.
This formula will set the TargetAddress value based on the
InternetAddress and prefix the domain with the value specified, in this case "domino.".
This formula will set the TargetAddress value based on the
InternetAddress and replace the domain with the value specified, in this case
"domino.contoso.com
SMART DIRECTORY SYNC 4.3.0.1 COMPREHENSIVE USER GUIDE FOR AD
MIGRATION/SYNCHRONIZATION AND EXCHANGE MIGRATION
85
Field Name
TargetAddress CASE WHEN InternetAddress LIKE '%@kodak.com' THEN 'smtp:' + dbo.UpdateInternetAddress(P.InternetAddress, 'domino.') WHEN
InternetAddress LIKE '%@knotes.contoso.com' THEN 'smtp:' + dbo.ReplaceDomain(P.InternetAddress, 'domino.contoso.com') ELSE
P.InternetAddress END
Field Value
CommonName CASE EntryType WHEN 'user' THEN 'do$$' + SourceDirectoryID WHEN
'sharedmail' THEN 'do$$' + SourceDirectoryID ELSE CommonName END
CommonName CASE WHEN LEN(CommonName) > 64 THEN
LTRIM(RTRIM(LEFT(CommonName,64))) ELSE CommonName END
Description
".
This formula will dynamically set the targetaddress value based on the existing
InternetAddress domain name value. If the first domain is found then the
TargetAddress will be set to one value, if the second domain is found another value will be used and if neither domain is found then the
TargetAddress will be set the same as the current
InternetAddress value.
This formula will dynamically set the
CommonName value based on the
EntryType.
This formula will limit the CommonName value to 64 characters if it exceeds that limit.
ProxyAddresse s
Company
CASE ProxyAddresses WHEN '' THEN 'smtp:' + dbo.ReplaceDomain(InternetAddress,'@contoso.mail.onmicrosoft.com;smt p:') + dbo.UpdateInternetAddress(InternetAddress,'domino.') ELSE
ProxyAddresses + ';smtp:' + dbo.ReplaceDomain(InternetAddress,'@contoso.mail.onmicrosoft.com;smt p:') + dbo.UpdateInternetAddress(InternetAddress,'domino.') END
This formula will set or append to the list of
ProxyAddresses values the coexistence routing addresses.
This example specifically is designed for Office 365.
LTRIM(RTRIM(LEFT(company, 50)))
BTCustom0XX "this is a string"
This formula will Trim, then limit the string value by 50 characters.
This formula will set any string value to the
SMART DIRECTORY SYNC 4.3.0.1 COMPREHENSIVE USER GUIDE FOR AD
MIGRATION/SYNCHRONIZATION AND EXCHANGE MIGRATION
86
Field Name Field Value
BTCustom0XX REPLACE(InternetAddress,'@','.')
BTCustom0XX LEFT(InternetAddress,CHARINDEX('@',InternetAddress)-1)
Description any SQL field.
This formula will replace the '@' symbol with a period '.' to create a string like so.
(i.e. first.last.contoso.com)
This formula will extract the localpart of
InternetAddress.
SMART DIRECTORY SYNC 4.3.0.1 COMPREHENSIVE USER GUIDE FOR AD
MIGRATION/SYNCHRONIZATION AND EXCHANGE MIGRATION
87