Keyturn docsStart here

How commands work

Learn these rules once; they hold for all 612 commands.

The grammar

keyturn <area> <action> [what] [--flags]

keyturn user show "Owen Price"
keyturn db compact mail/ --reduce-size --dry-run
keyturn acl set apps/sales.nsf --name -Default- --level reader

Help is built in, with real examples for every command:

$ keyturn --help                 # every area and action
$ keyturn help user              # one area, a line per action
$ keyturn user delete --help     # flags and examples
$ keyturn explain db compact     # what it does, how, and how it checks the result

Reads, changes and destructive changes

Every command has a tier. The command reference shows it next to each one.

TierMeaningWhat Keyturn asks
R ReadLooks only. 273 commands.Your sign-in. Never a code.
M ChangeChanges something that can usually be put back. 243 commands.A one-time code (when the server has require-otp).
D DestructiveDeletes, resets or can't be reversed. 96 commands.A code, and --yes (or a typed confirmation at the prompt).

Keyturn checks a change's own arguments and reads what it needs before it sends your code, so a mistyped name or a refused right leaves the code unspent.

Preview, then change

Almost every change takes --dry-run: it says what would change and changes nothing, with no code. Then run the same line without it. After a change, Keyturn reads the result back and says whether it took effect (the "verified by" line in each command's help says how).

Output for people and for scripts

FlagGives
-o text (default)Tables and sentences for people.
-o jsonThe domctl/v1 envelope: result, warnings, problems, meta. Stable for scripts.
-o csvAny read's rows as CSV, ready for Excel or a target list.

One server, several, or all

Reads (and a set of safe changes) fan out across servers. Each server is its own run, with its own sign-in and its own code, and the output has a section per server and a total.

keyturn session list --context-group domain        # every server you connected to
keyturn cert expiring --servers mail1,mail2         # named profiles
keyturn fleet report --all-servers                  # every Server document in the Directory
keyturn task restart http --servers mail1,mail2 --fan-out-changes --yes

A change across servers needs --fan-out-changes --yes on purpose, so it never happens by accident. Use --parallel N (4 by default) and --server-timeout (10 minutes) to pace it.

Plans: review many changes, approve once per server

A plan is a list of Keyturn commands you review and then apply as one run. Write one from a text file, a CSV, or any change with a target list. You approve it with one code per server, not one per change. The plan file never holds a code, password or token.

$ cat fix-acls.txt
acl set apps/sales.nsf  --name -Default- --level reader --server apps1
acl set apps/budget.nsf --name -Default- --level reader --server mail1
$ keyturn plan -f fix-acls.txt                   # writes keyturn-plan-<hash>.json and shows it
$ keyturn plan show keyturn-plan-4c7053e5f9dd.json
$ keyturn apply keyturn-plan-4c7053e5f9dd.json   # one code per server
$ keyturn batch status                           # runs on this machine
$ keyturn undo 20261110-051721-76d0 --dry-run    # reverse a run, last change first
  • Runs are journaled. If one stops (a failure, a closed laptop), keyturn batch resume RUN carries on from the first step not done.
  • Pacing: --rate 10/min spaces changes out; --window 22-06 only changes between those local hours; --keep-going runs past a failed step.
  • Undo covers ACL entries, group members, groups and people created, and Person fields. AdminP requests, console commands and deletes can't be undone, and Keyturn says so. Undo copies are kept 30 days.
  • Two-person rule (optional, plan-two-person = d-tier on the server): a plan with a destructive step waits for a second admin's keyturn plan cosign.

Bulk by intent

Instead of listing targets yourself, name them. Keyturn runs the read that finds them, says how many, then previews, plans or applies.

ForFlagsExample
Databases--all --folder DIR --template NAME --where EXPR --match GLOBdb quota set --folder mail --limit 2048 --warning 1800 --dry-run
People--where FORMULA --ou OU --members-of GROUPuser set CompanyName="Acme Boston" --ou Boston --dry-run
Groups--where FORMULA --with-member NAMEgroup remove --with-member "Pat Doe/Sales/Acme" --member "Pat Doe/Sales/Acme"
Your own list--targets FILE or --select '<read>'db quota set --targets mail.txt --limit 2048 --apply

Without --dry-run the line writes a plan for keyturn apply; add --apply to run it now. More than 25 targets at once also need --yes. Database facts for --where include sizeMB, freeMB, ods, fti, modifiedDays and template, for example --where 'sizeMB > 500 & !fti'.

Exit codes

CodeMeaning
0OK, including "already that way, nothing changed".
1Failed: refused, or did not take effect.
2Usage: a typo in the command line.
3Permission denied. The message names the right or license needed.
4Can't connect.
5Accepted, but not confirmed within --timeout. Check again rather than retry.
6Partly done (some steps of a batch failed).
7A precondition failed.
8Needs --yes. Nothing was sent.
9Sign-in needed: a password or a one-time code.
10A decision is open (export runs).

What gets logged

Every change, console command, sign-in and second-factor event goes to the server console and log.nsf with the person's name. No password or code is ever logged. Your own machine keeps a log too:

$ keyturn meta audit tail                # the last changes this machine made
$ keyturn meta audit export > audit.jsonl  # for a SIEM or an archive