AD FastReporter - Online Manual

Command-Line Interface

AD FastReporter includes a command-line tool, ADFastReporterCmd.exe, that executes scheduled tasks without the GUI. This is what Windows Task Scheduler calls when running automated reports, and you can also use it directly from scripts, batch files, or third-party schedulers.

Location

ADFastReporterCmd.exe is located in the same folder as the main AD FastReporter application — typically C:\Program Files\AlbusBit\ADFastReporter\ or wherever you installed the product.

Command-Line Arguments

Argument Required Description
-t <id> Yes The task ID to execute. This is the numeric ID shown in the Tasks list in the GUI.
-d No Enable debug logging for this execution. Writes detailed logs to the configured debug path.
-p <password> No Provide the AD connection password on the command line. Required if the task’s connection uses custom credentials and the password is not saved in Windows Credential Manager.

Examples

Run task 1:

ADFastReporterCmd.exe -t 1

Run task 3 with debug logging:

ADFastReporterCmd.exe -t 3 -d

Run task 2 with an explicit password:

ADFastReporterCmd.exe -t 2 -p "MyP@ssw0rd"

What Happens When a Task Runs

When ADFastReporterCmd.exe executes a task, it follows this sequence:

  1. License check — Verifies that a valid Pro or Trial license is registered. If the license is invalid or expired, the task exits with an error.
  2. Load task definition — Reads the task configuration (connection, report form, fields, filters, export settings, email settings) from the shared SQLite database.
  3. Generate report — Connects to Active Directory using the task’s connection settings and generates the report. Progress and status messages are written to the console.
  4. Export to file — If file export is enabled in the task, the results are exported to the configured path and format.
  5. Send email — If email delivery is enabled, the results are sent using the SMTP settings configured in the GUI’s Settings → Email.
  6. Save to history — If “Save report in database” is enabled, the results are stored in Report History.
  7. Log task history — A task history entry is created recording the date, record count, username, machine name, and any errors.

Console output includes the license mode, task start/end times, record count, and any errors.

Exit Codes

Code Meaning
0 Success — task completed without errors
100 Error — task failed (license invalid, connection failed, unexpected error)

Check the console output or debug logs for the specific error message when exit code 100 is returned.

Configuration File

ADFastReporterCmd.exe uses its own configuration file, cmdsettings.json, located in the same directory. This file contains the database connection string that points to the shared SQLite database:

{
  "ConnectionStrings": {
    "SqliteConnection": "Data Source=%APPDATA%\\adfastreporter.db"
  }
}

The %APPDATA% placeholder is resolved to %ProgramData%\AlbusBit\ADFastReporter\ at runtime. In most cases you don’t need to modify this file — it uses the same database as the GUI application by default.

If you’ve moved the database to a custom location using userSettings.json in the GUI, ADFastReporterCmd.exe reads that same userSettings.json from the application data folder, so both tools stay in sync.

Database Sharing

ADFastReporterCmd.exe reads from and writes to the same SQLite database as the GUI application. This means:

  • Tasks created in the GUI are immediately available to the command-line tool
  • Task history entries created by command-line execution appear in the GUI’s task history
  • Reports saved to history by the command-line tool are visible in the GUI’s History view
  • SMTP settings configured in the GUI are used by the command-line tool for email delivery

Using with Third-Party Schedulers

While AD FastReporter has built-in Windows Task Scheduler integration (configured through the task’s Schedule tab), you can also use ADFastReporterCmd.exe with any scheduler or automation tool:

  • Third-party job schedulers (e.g., VisualCron, ActiveBatch, etc.) — Configure a job that runs ADFastReporterCmd.exe -t <id>
  • Batch files / PowerShell scripts — Call ADFastReporterCmd.exe as part of a larger automation workflow, check the exit code, and take action based on success or failure
  • CI/CD pipelines — Include AD reporting as a step in infrastructure automation

When using third-party schedulers, ensure the run-as account has read access to Active Directory and write access to the export folder (if file export is configured).

Debug Logging

When using the -d flag (or when the task has “Enable debug logging” checked), detailed logs are written to:

%ProgramData%\AlbusBit\ADFastReporter\logs\

Log files are named by date and level, e.g., 2026-03-29_Debug.txt. These include the full LDAP query, field processing details, export operations, and email delivery status. The logs use the NLog framework and include timestamps, log levels, and the originating component.

A separate _MS_ prefixed log file captures Microsoft framework-level logging (Entity Framework, .NET runtime) which can help diagnose database or runtime issues.



Use of this site constitutes acceptance of our Privacy Policy and EULA. Copyright © Albus Bit SIA