Skip to main content

ADSync Tool Usage Guidelines

Overview

ADSync is a complex tool, and understanding its functionality is important to distinguish between expected behavior and malfunctioning scenarios.

There are certain actions which, as an Administrator, you should not take unless you fully understand and accept the consequences.

This document provides a comprehensive explanation of how ADSync works, equipping you with the knowledge to operate it effectively.

tip

Please make sure to read this document in its entirety before installing or starting the ADSync Service.


Installation

ADSync must be installed on ALL Active Directory Servers in the domain to ensure that all password changes are captured. Unlike other object changes, password changes are not always replicated between AD Servers.

Before installation, consider the following:

  • Will this server monitor:
    • User Changes
    • Contact Changes
    • Group Changes
  • Which AD Groups should be used for monitoring object changes?
  • Do you need to configure a custom workflow or make changes to the ADSync.exe.config file?
  • Are patches required post-installation?
  • Can the Active Directory Server access the Atria API Web Service over HTTP or HTTPS?

The ADSync Service starts automatically upon installation. However, it will not start if it cannot connect to the API and validate the customer information configured in the config file. If the service fails to start, installation fails and rolls back any changes. Therefore, ensure API access and valid credentials before installing.


Customizations After Install

If custom workflows, patches, or config file changes are required immediately after installation, stop the ADSync Service immediately after installation completes.

Stopping ADSync can take time, especially if tasks are still in progress. The best approach is to kill the process.

warning

Killing the process is only acceptable immediately after installation. Doing so at any other time can cause queue corruption.

tip

Before completing the install, open Task Manager in the Processes tab so you can quickly kill the ADSync.exe process.


Startup

When ADSync starts, it may begin cataloging AD objects in scope. This process can be time-consuming if many objects are involved. This behavior is controlled by the EventLogWatch setting.

EventLogWatch

  • True: Builds the catalog using the EventLog.
  • False: Catalog is not built.

This setting enables ADSync to use EventLogs for detecting AD changes. It captures the specific nature of the change, such as:

  • Type of object (new, changed, added/removed from a group)
  • Specific properties that changed

This data informs ADSync of actions to take without needing to send API requests to Atria.

It works with these additional settings:

  • UserAttributes, GroupAttributes, ContactAttributes
  • UserAttributesSyncOnChange, GroupAttributesSyncOnChange, ContactAttributesSyncOnChange
  • EventLogAddMemberEvents, EventLogRemoveMemberEvents, EventGroupAddMember, EventGroupRemoveMember

These help ADSync track relevant changes. It builds a catalog of in-scope items stored as .dat files in the Queue folder, maintained after startup.

If EventLogWatch is NOT set to True

ADSync relies on the LastUSN value in AD. It polls AD for objects with a higher LastUSN than the stored value, then:

  • Submits API requests to check if the object was previously synced
  • Submits another request to sync the object, even if the change is irrelevant

Setting EventLogWatch to True reduces load and improves performance, although it increases startup time.


Include and Exclude Groups

Exclude groups override include groups. If an object is not syncing, check for exclusion due to group membership.

info

Works like "Deny" in AD or the file system.

warning

Include and Exclude Groups must be Global Security Groups. ADSync may ignore members of other group types.


First-Time User Sync

When a user is first added to an "Include" group:

  • The user syncs with a blank password
  • Passwords sync only after a password change
note

Force users to change their password at next logon to ensure syncing.


Group Sync

Initial group GET requests:

  • Determine if a group and its members were previously synced
  • Block other sync activity until complete (can seem like a hang)

To avoid blocking, consider syncing large groups on a dedicated AD Server.


Log File

Logs are created under the ADSync\Logs folder daily (default 5MB).

tip

Consider moving logs to a separate drive or increasing their size.

Settings related to logging
AttributeDescription
maxFileSizeMax log size in bytes. Logging stops when limit is reached.
logFileCreationScheduleControls rotation: None, Daily, Weekly
customLocationPath for log files (e.g., a separate disk)
reserveDiskSpaceMin disk space required to allow log growth
Logging Options

The LogMask setting controls exception details. It's a bitmask:

NameValue
Message1
Exception2
Inner Exceptions4
Error Code8
Extended16
Stack Trace32768
Everything65535

Filtering Options

The initializeData attribute in the FileLogTraceListener filter node controls logged detail:

Log LevelDescription
CriticalLogs only critical events
ErrorLogs critical and error events
WarningLogs critical, error, and warning events
InformationLogs up to information events
VerboseLogs everything including verbose events
ActivityTracingLogs stop, start, suspend, transfer, and resume events
AllLogs all events

Operation

Stopping and Starting the ADSync Service

Stopping can take a long time if tasks are pending.

warning

Do not kill the process unless immediately after install. It can corrupt the queue.

If the queue is corrupt:

  • Delete all files and folders in the ADSync\Queue folder except SyncActiveDirectory.config
info

Restarting the service rebuilds the catalog. This may take time.

Syncing Large Numbers of Items

Large syncs increase queue size, API, and SQL activity.

Use ThrottleUploads to limit items queued at once:

  • Set ThrottleUploads = True
  • Set ThrottleLimit = 50-100

This approach:

  • Prevents excess API calls
  • Ensures constant queue activity without overload
  • Improves performance

Syncing Groups with Many Members

Syncing large groups requires ADSync to:

  • Check sync status of all members via API
  • Wait for API responses before continuing
warning

Do not restart or kill the service. Be patient.

info

Increase API timeouts to avoid failed requests.

Enable BatchUploads and set UploadBatchSize to process groups in chunks:

  • Set BatchUploads = True
  • Set UploadBatchSize = 50-100

This:

  • Prevents timeouts
  • Enables progress logging
  • Improves visibility


Maximum Log File Size

Increase log size to 10MB:

<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" location="Custom" customLocation="...\\ADSync\\Logs" logFileCreationSchedule="Daily" traceOutputOptions="DateTime" autoFlush="True" maxFileSize="10000000">
<filter type="System.Diagnostics.EventTypeFilter" initializeData="ActivityTracing,Information"/>
</add>
Create an Error Log

Create a log for warnings/errors:

<add name="FileLogErrors" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" location="Custom" customLocation="...\\ADSync\\ErrorLogs" logFileCreationSchedule="Daily" traceOutputOptions="DateTime" autoFlush="True" maxFileSize="10000000">
<filter type="System.Diagnostics.EventTypeFilter" initializeData="Warning"/>
</add>
Update listener
<sources>
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<remove name="Default"/>
<add name="EventLog"/>
<add name="FileLog"/>
<add name="FileLogErrors"/>
</listeners>
</source>
</sources>

ApplicationSettings Table


Application Settings
NameValueReason
UserPollTime20Reduces AD load
UploadPollTime20Reduces API and SQL load
LogMask65535Logs full error details
UploadMaxErrors2Limits retries
EventLogWatchTrueImproves efficiency via EventLog
UserAttributesSyncOnChangeTrueSyncs only changed attributes
ContactAttributesSyncOnChangeTrue
GroupAttributesSyncOnChangeTrue
MaxGetStatusTries5Re-submits stuck objects
ThrottleUploadsTrueLimits active queue size
ThrottleLimit50-100Optimal queue size
BatchUploadsTrueReduces size of group sync requests
UploadBatchSize50Optimal chunk size
MaxResubmits2Prevents endless retries

Increase API Timeout

Although APITimeout may be set to -1 (infinite), IIS has a default timeout of 110 seconds.

info

Syncing large groups may take 15+ minutes. Increase IIS timeout in the API's web.config:

<system.web>
<httpRuntime executionTimeout="1800"/>
</system.web>

Set to 1800 seconds (30 minutes) or higher, like 10000, to prevent timeouts.


If you experience any issues or require any assistance, please contact us at support@getatria.com.