Fix it now
Office is running without an activated licence. Microsoft publishes no description for 0x4004F00C, and its severity bit marks it a success result rather than a failure, so read it as a state report: no licence has been installed and activated on this machine. Install the key you own and activate.
cd "C:\Program Files\Microsoft Office\root\Office16"
cscript ospp.vbs /dstatus
cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
cscript ospp.vbs /act
cscript ospp.vbs /dstatus
- Read the first
/dstatusoutput before you type a key. It names the licence, the channel and the licence status, and that tells you whether a key was ever installed. - If the output names a KMS client channel, this machine expects a KMS host rather than a typed key. Point it at one with
cscript ospp.vbs /sethst:kms.contoso.localand run/act. - If the applications are Microsoft 365 Apps, stop. Microsoft states that ospp.vbs does not work for Microsoft 365 Apps or subscription Project and Visio; that is a sign-in and licence-assignment problem instead.
- To see the text your own machine holds for the code, run
cscript ospp.vbs /ddescr:0x4004F00C.
The path above is the documented one for Click-to-Run Office, which includes every LTSC release. Only MSI-based Office 2016 and earlier use the same path without \root\.
If /dstatus now reports a licensed status you are done. If it does not, the next section explains which of the four situations you are in.
Why it happens
This code needs unpicking before the fix makes sense. Microsoft does not publish a description for 0x4004F00C anywhere on learn.microsoft.com or support.microsoft.com. What can be established is its shape: the HRESULT layout Microsoft documents puts a severity bit at the top, and when that bit is clear the result is a success rather than a failure. 0x4004F00C has it clear. The code Microsoft does publish for a grace period that has ended is 0xC004F009, “The Software Protection Service reported that the grace period expired”, and that one carries a failure severity.
So the honest reading is a state report rather than an expiry notice: Office is running, no licence has been activated, and the licensing service is telling you which state it is in. Whether the clock has actually run out is a separate question, and /dstatus answers it directly by printing the remaining period.
The reason a grace period exists at all is deployment. An administrator rolling out hundreds of machines cannot rely on every one reaching an activation service during setup, so the installation runs normally while the licensing state is unresolved. In a healthy deployment activation happens quietly inside that window and nobody ever sees this code. Seeing it means activation did not happen, and the question worth answering is why.
What happens when the window does close is worth stating precisely, because most descriptions of it are embroidered. Microsoft publishes that “Unlicensed Product” appears in the title bar and that most features of Office are disabled. It does not publish a feature-by-feature list, so treat confident claims about exactly what still works as guesswork.
Office was deployed without a key
You have this one if /dstatus reports no installed product keys, and the deployment was scripted or done from a package.
- Install the key you own:
cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX. - Activate:
cscript ospp.vbs /act. - Confirm with
cscript ospp.vbs /dstatus. - Add the key to your deployment configuration so the next batch of machines does not repeat it.
A key installed after the window closes still works. Running out of grace does not disqualify the installation, it only stops it running unlicensed.
A volume installation never reached its KMS host
You have this one if The licence name describes a KMS client channel, and the machine has been off the network, on a restricted segment, or at a site with no host.
- Point Office at the host:
cscript ospp.vbs /sethst:kms.contoso.local. - Set the port only if the host does not use 1688:
cscript ospp.vbs /setprt:<port>. - Activate with
cscript ospp.vbs /act. - Return the client to automatic discovery afterwards with
cscript ospp.vbs /remhst, which also resets the port to 1688.
Office and Windows activate independently. A machine with Windows happily activated can still have Office sitting unlicensed.
This is Microsoft 365 Apps, not a keyed installation
You have this one if The applications are the subscription build, and File, Account shows a missing account or a licence error.
- Open any Office application, choose File then Account, and check which account is signed in.
- Sign out of the wrong account and sign in with the one carrying the licence.
- Confirm in the Microsoft 365 admin centre that the user has a licence assigned. An unassigned user never activates, whatever is typed at the machine.
- Do not use ospp.vbs here. Microsoft states the script does not work for Microsoft 365 Apps or subscription Project and Visio.
A trial or evaluation build reached the end of its life
You have this one if The installation was a trial or preview and no purchased key was ever meant to follow it.
- Establish which edition is installed: File, then Account, then About.
- Install a key for that edition, or deploy the edition you are actually licensed for.
- Check the product ID as well as the edition name. Microsoft states plainly that if you use the wrong product ID, you cannot activate Office.
Full reference
Reading the /dstatus output properly
| What the output shows | What it means |
|---|---|
| No installed product keys found | Office was deployed without a key. Install one |
| A key is listed and the status is not licensed | The key installed but activation never completed |
| A licence name naming a KMS client channel | A volume install that expected a KMS host and did not find one |
| A licence name naming a retail channel | A retail key installed but not activated, or refused |
| The command returns nothing useful | You are in the wrong folder, or this is Microsoft 365 Apps and ospp.vbs does not apply |
Where ospp.vbs lives
Microsoft’s tools reference gives Program Files\Microsoft Office\root\Office16 for 64-bit Office and Program Files (x86)\Microsoft Office\root\Office16 for 32-bit Office on a 64-bit operating system, and notes that earlier versions may not include the root segment. Every LTSC release is Click-to-Run, so on Office LTSC 2021 and 2024 the path without root does not exist at all. If a set of instructions sends you to the shorter path and the folder is not there, that is why.
The switches worth knowing
| Switch | What Microsoft says it does |
|---|---|
/dstatus |
Displays licence information for installed product keys |
/dstatusall |
Displays licence information for all installed licences |
/inpkey:<key> |
Installs a product key, replacing an existing key |
/unpkey:<last five> |
Uninstalls an installed key, identified by its last five digits as shown by /dstatus |
/act |
Activates installed Office product keys |
/rearm |
Resets the licensing status for all installed Office product keys |
/ddescr:<code> |
Displays the description for a supplied error code |
/sethst:<name> and /setprt:<port> |
Set the KMS host name and port |
/remhst |
Removes the KMS host name and resets the port to the default 1688 |
On rearming instead of licensing
ospp.vbs /rearm resets the licensing status for installed Office keys, and it exists so that an administrator can capture a reference image without burning the deployment window. Microsoft does not publish how many times it can be used, so treat any specific number you are given as unsourced. What is safe to say is that it resets a state rather than granting an entitlement, and an installation kept alive by repeated rearms is unlicensed for as long as that continues.
If you are rearming to capture an image, the documented step before Sysprep for Office is OSPPREARM.EXE, which generates unique Office client machine IDs. Skipping it is the usual reason a whole deployment later fails to raise a KMS count.
How long a licensed volume installation actually lasts
| Interval | What Microsoft publishes |
|---|---|
| Licensed period after a KMS activation | 180 days |
| Renewal attempt | Once every seven days by default, configurable |
| After 180 days without activation | Office goes into the out-of-tolerance state for 30 days |
| Active Directory-based activation | Lasts up to 180 days, renewed by querying the directory |
Those numbers are why a KMS estate rarely fails on the day something breaks. A client that activated last month has months of margin and keeps asking in the background. It becomes visible when a whole site has been unable to renew for six months and reaches the end of the window together.
What the other three codes are
0x4004F00D, 0x4004F009 and 0x4004FC05 have no published descriptions either. 0x4004F009 is worth one extra sentence: it differs from the documented 0xC004F009, “the grace period expired”, only in the severity bit, which is the difference between a notice and a failure. If you need to know what any of them says on your machine, cscript ospp.vbs /ddescr: with the code prints it.
When a licence is the actual fix
If /dstatus shows no key and there never was one, this is not a fault to troubleshoot. The installation has been running on borrowed time and the time is up. For machines that should not be on a subscription, a perpetual Office LTSC 2024 Professional Plus licence is the straightforward answer: one key, installed with /inpkey: and activated in a minute, with no recurring commitment and no dependency on a user signing in. Arco supplies Office LTSC 2024 licences and can confirm which edition covers the applications your users actually open, since paying for Professional Plus where Standard covers the workload is the commonest way organisations overspend here.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
0x4004F00C |
Reported by Office when no licence has been activated. No published description; its severity bit marks it a success result rather than a failure | not published by the vendor |
0x4004F00D |
Same family, no published description | not published by the vendor |
0x4004F009 |
No published description. Differs only in the severity bit from 0xC004F009, which Microsoft publishes as the grace period having expired | not published by the vendor |
0x4004FC05 |
Reported by the Activation Wizard. No published description | not published by the vendor |
Confirm the fix worked
cscript ospp.vbs /dstatusreports a licensed status with no remaining grace counter.- The licence name matches the edition shown in File, Account, About.
- Word or Excel opens with no Unlicensed Product wording in the title bar.
- A test document saves normally.
- Reboot and repeat the check, since an activation that has not committed shows itself on the next start.
Questions people ask about this
Does 0x4004F00C mean my grace period has ended?
Not on its own. Microsoft publishes no description for it, and its severity bit marks it a success result rather than a failure. The code Microsoft does publish for an expired grace period is 0xC004F009. Read the remaining period in the /dstatus output rather than inferring it from the code.
Will I lose the documents I have open?
No. Microsoft’s published position is that Unlicensed Product appears in the title bar and most features are disabled. Your files are not touched, and full function returns as soon as a licence activates.
Can I keep rearming instead of buying a licence?
The rearm switch resets a licensing status, not an entitlement. Microsoft publishes no count for how often it can be used, so anyone quoting you a number is guessing. An installation kept alive that way is unlicensed for as long as it continues.
Do I have to uninstall Office before installing a key?
No. Install the key with /inpkey: and activate. A reinstallation is only needed when the installed product does not match the key you hold, and the product ID list is the place to check that.
Why does ospp.vbs return nothing on my machine?
Either you are in the wrong folder, or this is Microsoft 365 Apps. Microsoft states the script does not work for Microsoft 365 Apps or subscription versions of Project and Visio, so on those the answer is sign-in and licence assignment rather than a key.
