DbTool Recovery Commands
The recovery commands search Active Directory snapshots and the Active Directory Recycle Bin, and roll back or recover objects in bulk.
For a step-by-step bulk recovery workflow, see Recycle Bin for Active Directory.
For how to run DbTool, the common options, and the permissions it requires, see DbTool Command-Line Utility.
recovery search-snapshots
Searches the stored Active Directory snapshots for objects that match a filter, and reports which snapshots are available for each object.
Requirements: Cygna Auditor must be licensed for Recovery for Active Directory.
Syntax
DbTool recovery search-snapshots [options]
This command has no options other than the Common Options.
recovery search-recycle-bin
Searches the Active Directory Recycle Bin for deleted objects. Use --file to save the results as the input file for recovery rollback.
Requirements: Cygna Auditor must be licensed for Recovery for Active Directory.
Syntax
DbTool recovery search-recycle-bin [options]
Options
| Option | Description |
|---|---|
--classes <CLASSES>
|
Comma-separated list of objectClass values to return, for example user,group. Omit this option to return every class. |
--contains <TEXT>
|
Comma-separated list of text fragments. An object is returned when its distinguished name contains any of them. |
--parent <DISTINGUISHED_NAME>
|
Return only objects whose last known parent is this container. Use this option to recover one deleted organizational unit at a time. |
--before <DATE_TIME>
|
Return only objects deleted before this date and time. |
--limit <COUNT>
|
Stop after this many matching objects. Default: 100. |
--file <PATH>
|
Write the distinguished name of every matching object to this file, for use as the input to recovery rollback. Deleted objects are written under their current Recycle Bin name. |
--dc <DOMAIN_CONTROLLER>
|
Domain controller to search. Default: the closest domain controller. |
Example
DbTool recovery search-recycle-bin --classes user,group --file C:\temp\deleted.txt
recovery rollback
Rolls back or recovers (undeletes) every object listed in a file of distinguished names, using the stored snapshots.
Before it makes any changes, the command displays a summary of what it will do and asks you to press Y to continue. Press any other key to cancel.
Recovered user accounts are left disabled and without a usable password unless you specify --enableuser and --setpassword. If you specify --setpassword without --enableuser, setting the password fails for disabled accounts.
Requirements: Cygna Auditor must be licensed for Recovery for Active Directory.
Syntax
DbTool recovery rollback --file <PATH> [options]
Options
| Option | Description |
|---|---|
--file <PATH>
|
Required. Text file that lists one distinguished name per line. recovery search-recycle-bin --file writes a file in this format. |
--targetdate <DATE_TIME>
|
Roll each object back to the latest snapshot taken before this date and time. Default: the most recent snapshot. |
--attributes <ATTRIBUTES>
|
Comma-separated list of attributes to roll back. Omit this option to roll back every writable attribute. |
--clear-added-attributes
|
After rolling back, also clear attributes that are set on the live object but not in the snapshot, so that the object matches the snapshot exactly. Ignored when --attributes is specified. |
--recoverchildren
|
Also recover all objects beneath each listed object, using the most recent snapshot of each child object. |
--enableuser
|
Enable each user account after it is recovered or rolled back. |
--setpassword <PASSWORD>
|
Set every recovered user account to this password. |
--clearpasswordflag
|
Clear the User must change password at next logon flag on every user account that is recovered or rolled back. |
--dc <DOMAIN_CONTROLLER>
|
Domain controller to write the changes to. Default: the closest domain controller. |
--user <ACCOUNT>
|
Domain account with rights to undelete objects and write every attribute. Default: the account running DbTool. |
--password <PASSWORD>
|
Password for --user. Enter ? to be prompted for the password instead of typing it on the command line. |
--parallel <COUNT>
|
Number of objects to process at the same time. Default: the number of processors on this computer. |
--report <PATH>
|
Path of a report file that records the result for each object. No report is written if you omit this option. |
Example
DbTool recovery rollback --file C:\temp\deleted.txt --enableuser --report C:\temp\rollback.csv
recovery compress-snapshots
Compresses stored Active Directory snapshots in bulk to reclaim database space. Compressed snapshots remain fully searchable.
Requirements: Cygna Auditor must be licensed for Recovery for Active Directory.
Syntax
DbTool recovery compress-snapshots [options]
This command has no options other than the Common Options.