0X00002140

Fix Active Directory install error 0x00002140

Windows Errors Intermediate 👁 8 views 📅 May 27, 2026

This error hits when you try to promote a server to a domain controller using an unattended install file that's missing or has the wrong schema version.

You're trying to promote a Windows Server 2012 R2 or 2016 box to a domain controller using an unattended install file (say, C:\AD\answer.txt). You run dcpromo /unattend:C:\AD\answer.txt and—bang—you get this error:

Active Directory Installation Failed.
Unable to find the schema version in the answer file.
ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE (0X00002140)

This happens most often when you copy an old answer file from a Windows Server 2003 or 2008 install and try to reuse it on a newer server. That old file lacks the SchemaVersion line that newer versions of dcpromo expect. The installer literally can't tell what schema level you're targeting, so it bails out before doing anything.

What's really going on?

The answer file is a plain text INI file with sections like [DCINSTALL]. In older Windows versions (2000–2008), dcpromo didn't care about a schema version entry—it just used the current forest schema. Starting with Windows Server 2008 R2 and definitely by 2012 R2, Microsoft added a hard requirement: the answer file must include a SchemaVersion key under [DCINSTALL]. Without it, the installer throws 0x00002140 and stops. No warnings. No second chances.

The fix is simple: open your answer file, find the [DCINSTALL] section, and add a line that tells dcpromo what version of the Active Directory schema you're working with. For most domains running Server 2012 R2 or later, that version is 56 (for Server 2012 R2) or 69 (for Server 2016/2019). If you're not sure, SchemaVersion = 56 is safe for 2012 R2 and below. For 2016 or later, use 69.

Step-by-step fix

  1. Open your answer file in Notepad.
    Right-click the file, pick Open with, choose Notepad. Don't use Word or anything that might add formatting.

  2. Locate the [DCINSTALL] section.
    It's usually near the top. It looks like this:

    [DCINSTALL]
    ReplicaOrNewDomain=Replica
    ... other settings ...
  3. Add a line for SchemaVersion right under [DCINSTALL].
    Type it exactly like this (no extra spaces):

    SchemaVersion=56

    For Server 2016, 2019, or 2022, use 69 instead. If you don't know your target schema version, check the domain function level: for 2012 R2 use 56, for 2016+ use 69.

  4. Save the file.
    File > Save. Close Notepad.

  5. Run dcpromo again with the same command.
    Open Command Prompt as Administrator, type:

    dcpromo /unattend:C:\AD\answer.txt

    After you hit Enter, you should see the promotion start without the schema version error. The screen will show "Active Directory Installation Wizard" and proceed through the steps.

Still failing? Check these three things

  • Wrong schema version number. If you used 56 but your existing domain controllers are running Server 2016, the installer might reject it. Try 69 instead. You can find your current forest's schema version by running dsquery * CN=Schema,CN=Configuration,DC=YourDomain,DC=com -scope base -attr objectVersion in an AD-joined server.
  • Answer file in the wrong format. Ensure the file uses Windows-style line endings (CRLF). If you edited it on a Linux machine, it might have LF-only endings, which dcpromo can choke on. Open it in Notepad and re-save to fix.
  • Missing other required keys. dcpromo is picky. Your answer file also needs ReplicaOrNewDomain, SafeModeAdminPassword, and—for a replica—ReplicaDomainDnsName. Without them, you'll get different errors, but fixing the schema version is the first step.

That's it. Add the schema version line, save, re-run, and the error goes away. I've seen this trip up admins who migrate from old unattended files—it's an easy miss. Now you know exactly where to look.

Was this solution helpful?