Activating Office Using PowerShell [Complete Guide]
Microsoft Office is one of the most widely used productivity suites for creating documents, spreadsheets, presentations, and emails. After installing Office, one of the first tasks is to activate the software. Activation verifies that your copy of Office is genuine and properly licensed. Without activation, certain features may become unavailable, and you may see frequent activation reminders.
Many users are familiar with activating Office through the graphical interface, but PowerShell provides another reliable way to perform activation. PowerShell is a command-line automation tool included with Windows that allows you to execute commands and scripts. Although PowerShell itself does not activate Office directly, it can be used to run Microsoft’s Office Software Protection Platform (OSPP) script, which handles Office licensing and activation.
In this guide, I have explained how to activate Office using PowerShell in a safe and legitimate way.
Activating Office Using PowerShell [Complete Guide]

Using PowerShell to activate Microsoft Office is useful when the normal activation process fails or when you need to activate Office on multiple computers. The process involves opening PowerShell with administrator permissions, locating the Office installation folder, and running Microsoft’s official OSPP.VBS licensing script.
This method supports Microsoft Office versions that include the OSPP licensing tool, such as Office 2016, Office 2019, Office 2021, and Microsoft 365 desktop apps. Before proceeding, make sure you have a valid product key or that your organization provides a Key Management Service (KMS) or another legitimate licensing method.
Using unauthorized activation tools or scripts can violate Microsoft’s licensing terms and may expose your computer to security risks.
Step 1: Confirm That Microsoft Office Is Installed Correctly
Before opening PowerShell, verify that Microsoft Office is installed properly on your computer. Open any Office application, such as Word, Excel, or PowerPoint. If the application opens normally, the installation is likely complete. If Office asks you to sign in or activate the product, that simply means activation has not yet been completed.
It is also helpful to identify whether you are using the 32-bit or 64-bit version of Office because the installation path differs between the two. You can find this information by opening an Office app, selecting File, then Account, followed by About. Keep this information ready before continuing.
Step 2: Open PowerShell with Administrator Permissions
The activation commands require administrative privileges.
Click the Start button and type PowerShell into the search box. When Windows PowerShell appears in the results, right-click it and choose Run as administrator. If the User Account Control window appears, select Yes to allow PowerShell to launch with elevated permissions.
You should now see a blue PowerShell window. Running PowerShell as an administrator ensures that licensing commands can access the necessary Office files without permission errors.
Step 3: Navigate to the Office Installation Folder
PowerShell must be directed to the folder where the Office licensing script is stored.
For most 64-bit Office installations, type the following command:
cd “C:\Program Files\Microsoft Office\Office16”
If you have a 32-bit Office installation on a 64-bit Windows computer, use:
cd “C:\Program Files (x86)\Microsoft Office\Office16”
After entering the appropriate command, press Enter.
If the command returns an error stating that the path cannot be found, verify your Office installation folder. Some Office editions may use a different installation directory depending on how they were installed.
Step 4: Check the Current Office License Status
Before attempting activation, it is a good idea to view the current licensing status.
Run the following command:
cscript ospp.vbs /dstatus
PowerShell will display information about your Office installation, including the license status, last five characters of the installed product key, and activation details.
If Office is already activated, the status will indicate that the product is licensed. If not, continue with the remaining steps.
Step 5: Install Your Product Key If Needed
If your Office installation does not already contain a valid product key, you must install one before activation.
Replace the example key below with your own 25-character Microsoft Office product key.
cscript ospp.vbs /inpkey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
Press Enter after typing the command.
If the product key is accepted, PowerShell will display a confirmation message indicating that the key has been installed successfully.
Be sure to enter the key exactly as provided. A single incorrect character can prevent successful activation.
Step 6: Activate Microsoft Office
Once the correct product key is installed, you can begin activation.
Enter the following command:
cscript ospp.vbs /act
Press Enter.
PowerShell will communicate with Microsoft’s activation servers or your organization’s activation service. If everything is configured correctly, a message will appear indicating that product activation was successful.
The activation process usually completes within a few seconds, although it may take longer depending on your internet connection.
Verify That Office Has Been Activated Successfully
After activation finishes, verify that everything worked correctly.
Run the following command again:
cscript ospp.vbs /dstatus
Review the results displayed in the PowerShell window. The License Status should indicate that the product is licensed.
You can also open any Office application and go to File> Account. Under Product Information, Office should indicate that it is activated.
Checking the activation status confirms that the process completed successfully and helps identify any remaining licensing issues.
Troubleshoot Activation Problems
Sometimes activation may not succeed on the first attempt.
If you receive an invalid product key message, double-check that the key matches your Office edition. For example, a Microsoft 365 subscription cannot be activated with a perpetual Office 2021 retail key.
If the activation server cannot be reached, ensure that your computer has a stable internet connection and that your firewall or proxy settings are not blocking activation requests.
If you are using a work or school computer, activation may depend on your organization’s licensing server. In this case, contact your IT administrator for assistance.
If PowerShell cannot locate OSPP.VBS, verify that you are in the correct Office installation folder before running any commands.
Finally, install the latest Office updates through Microsoft Update, as outdated Office installations may occasionally experience activation issues.
FAQs
Can PowerShell activate Microsoft Office by itself?
No. PowerShell simply runs Microsoft’s official licensing commands. A valid Office license, product key, or supported activation method is still required.
Is activating Office through PowerShell safe?
Yes. Using Microsoft’s official OSPP.VBS licensing script through PowerShell is safe and supported when you are activating a legitimately licensed copy of Microsoft Office.
Does this method work for Microsoft 365?
Yes. Many Microsoft 365 desktop installations include the OSPP licensing tool. However, subscription-based licenses are commonly activated by signing in with the Microsoft account associated with the subscription.
What does OSPP.VBS do?
OSPP.VBS is Microsoft’s Office Software Protection Platform script. It manages licensing tasks such as displaying license information, installing product keys, and activating Office.
Can I activate Office without an internet connection?
Some licensing methods may support offline activation, but most retail and Microsoft 365 installations require internet access during activation.
Why does PowerShell show that the folder cannot be found?
This usually means Office is installed in a different directory or that the installed version uses another folder name. Verify your Office installation path before running the commands.
Is it legal to use activation scripts found online?
No. Only use Microsoft’s official licensing tools together with a valid license or product key. Unauthorized activation scripts and bypass tools may violate Microsoft’s license agreement and can put your computer at risk.
Summary
Activating Microsoft Office using PowerShell is a practical method for users who prefer command-line tools or need to troubleshoot activation problems. By opening PowerShell as an administrator, navigating to the Office installation folder, checking the license status, installing a valid product key when necessary, and running Microsoft’s official activation command, you can activate Office safely and correctly.
Always use a genuine Microsoft Office license or a valid organizational licensing method. Avoid unofficial activation utilities, as they can compromise your computer’s security and violate licensing terms.
Once activation is complete, verify the license status to ensure Office is fully activated and ready for everyday use.
