This spectacular MSDN article details how to do it in C++. And it vaguely mentions some utilities that don't appear to be on my system at all, and gives no ideas how to do this from a regular Windows Server 2003 R2 or Windows Server 2003 domain controller.
The need to detect an active directory schema master occurs because (even though I can't figure out how this happened) I am trying to run adprep
as a step in upgrading from 2003 to 2008R2 or 2012 server level domains, but its first command that you run (adprep /domainPrep and adprep /forestPrep) should be run on something called the "Schema Master".
From a GUI
On a computer with the AD tools installed (ADUC, Sites & Services, etc)
Run
regsvr32 schmmgmt.dll
from an elevated command promptRun mmc.exe
In the empty console that opens add the Active Directory Schema Management snap-in.
Right click on the Schema icon and select Operations Master. This will show you who currently holds it and allow you to transfer it.
From the command line
netdom query fsmo
.netdom.exe
is built into Windows 7 (and maybe Vista) and it part of the 2003 Resource Kit. I believe that it is also installed on 2003 Domain Controllers during dcpromo.