Automating Office 2010 MAK Activation After Unattended Installation via Command Line


2 views

When deploying Office 2010 in enterprise environments using the Office Customization Tool (OCT), administrators often encounter post-installation activation hurdles. The MAK key gets embedded during setup but doesn't trigger automatic activation, leaving installations in a grace period state.

In lab environments with frequent reimaging, manual activation isn't practical. The solution needs to:

  • Run without user interaction
  • Handle activation failure gracefully
  • Log results for audit purposes
  • Work within Windows login scripts or deployment pipelines

Office 2010 provides the ospp.vbs script for license management. Here's the silent activation command:

cscript "C:\Program Files\Microsoft Office\Office14\ospp.vbs" /act

For production use, we should enhance the basic command:

@echo off
SET LOG="C:\Windows\Temp\OfficeActivation.log"
SET OFFICEDIR="C:\Program Files\Microsoft Office\Office14"

echo %date% %time% - Starting Office activation >> %LOG%
cscript %OFFICEDIR%\ospp.vbs /dstatus >> %LOG%
cscript %OFFICEDIR%\ospp.vbs /act >> %LOG%
cscript %OFFICEDIR%\ospp.vbs /dstatus >> %LOG%
echo %date% %time% - Activation completed >> %LOG%

Consider these implementation methods:

  1. Group Policy Startup Script:
    \\domain\sysvol\scripts\activate_office.cmd
  2. SCCM/MDT Task Sequence:
    Add as a post-installation step in your deployment workflow
  3. Login Script Conditional Execution:
    IF EXIST "%ProgramFiles%\Microsoft Office\Office14\WINWORD.EXE" (
      call \\server\share\activate_office.cmd
    )

When the script fails, check these aspects:

Error Solution
0xC004F017 Verify network connectivity to Microsoft servers
0xC004F074 Check MAK key validity and remaining activations
Script not found Confirm Office installation path (32-bit vs 64-bit systems)

For environments with strict security policies preventing script execution:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Registration]
"DigitalProductID"=hex:...
"ProductName"="Microsoft Office Professional Plus 2010"
"ProductID"="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"

Note: The hex data varies per installation and should be captured from a reference machine.


When deploying Office 2010 via OCT (Office Customization Tool) with MAK licensing, the product installs with the key embedded but doesn't perform automatic activation. This creates user interruption in lab environments where we need fully automated deployments.

We'll use a combination of OSPP.VBS (Office Software Protection Platform script) and Windows scripting to achieve silent activation post-installation. This method works for both 32-bit and 64-bit Office 2010 installations.

First, verify your Office installation path. For standard deployments, OSPP.VBS is typically located at:

%ProgramFiles%\Microsoft Office\Office14\OSPP.VBS
or
%ProgramFiles(x86)%\Microsoft Office\Office14\OSPP.VBS

Create a VBScript file (activate.vbs) with the following content:

Set objShell = CreateObject("WScript.Shell")
officePath = objShell.ExpandEnvironmentStrings("%ProgramFiles%") & "\Microsoft Office\Office14\"

' Check if 64-bit path exists, if not use 32-bit path
If Not objShell.FileSystemObject.FileExists(officePath & "OSPP.VBS") Then
    officePath = objShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%") & "\Microsoft Office\Office14\"
End If

' Execute activation command
activationCmd = "cscript """ & officePath & "OSPP.VBS"" /act"
objShell.Run activationCmd, 0, True

To integrate this with your existing unattended setup, add these lines to your batch file after Office installation completes:

@echo off
cscript "%ProgramFiles%\Microsoft Office\Office14\OSPP.VBS" /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
cscript "%ProgramFiles%\Microsoft Office\Office14\OSPP.VBS" /act

Replace XXXXX... with your actual MAK key. The /inpkey parameter sets the product key (if not already configured in OCT), and /act performs activation.

To verify successful activation and handle potential errors, extend the script with status checking:

Set objShell = CreateObject("WScript.Shell")
officePath = objShell.ExpandEnvironmentStrings("%ProgramFiles%") & "\Microsoft Office\Office14\"

If Not objShell.FileSystemObject.FileExists(officePath & "OSPP.VBS") Then
    officePath = objShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%") & "\Microsoft Office\Office14\"
End If

' Perform activation
objShell.Run "cscript """ & officePath & "OSPP.VBS"" /act", 0, True

' Check activation status
activationStatus = objShell.Exec("cscript """ & officePath & "OSPP.VBS"" /dstatus")
Do While activationStatus.Status = 0
    WScript.Sleep 100
Loop

output = activationStatus.StdOut.ReadAll
If InStr(output, "LICENSE STATUS:  ---LICENSED---") > 0 Then
    ' Log success to file
    objShell.Run "cmd /c echo Office 2010 activated successfully >> C:\logs\office_activation.log", 0, True
Else
    ' Log failure and exit with error code
    objShell.Run "cmd /c echo Office 2010 activation failed >> C:\logs\office_activation.log", 0, True
    WScript.Quit(1)
End If

For environments where scripting isn't preferred, you can also use Group Policy Preferences to deploy a scheduled task that runs the activation command after deployment. The task can be configured to run once during the next system start.

1. Ensure your MAK key has sufficient activations remaining
2. The activation must occur after the network connection is established
3. For lab environments with identical hardware, consider using reimaging rights instead of individual activations
4. Activation status can be manually checked using: cscript ospp.vbs /dstatus