

The signoutofwamaccounts.ps1 script will remove the tokens and accounts associated with Office and is safe to run. There are no steps that you can run manually to clear WAM accounts associated with Office on the device for AADJ and HAADJ devices.ĭownload the signoutofwamaccounts.zip file, extract, and run the signoutofwamaccounts.ps1 script as administrator. These configurations use Web Account Management (WAM), which stores credentials in different locations. Devices are considered managed if they're Azure AD Joined (AADJ), Hybrid Azure AD Joined (HAADJ), or Workplace Joined (WPJ). Section B: Clear cached Office credentials for managed devicesįor managed devices, there are additional locations from which you need to remove cached Office credentials.

Run the following command to get a list of the licenses currently in use: cd "C:\Program Files (x86)\Microsoft Office\Office16".For a 32-bit Office installation on a 64-bit operating system:.cd "C:\Program Files\Microsoft Office\Office16".For a 64-bit Office installation on a 64-bit operating system:.Run one of the following commands from an elevated command prompt, as appropriate for your Office installation: The user account you use is a member of the Administrators group on the computer on which you run the script.īefore you run the ospp.vbs script, you must set the correct directory.
Remove office license cmd windows#

The process consists of the following sections. If you prefer to perform the steps for the cleanup process manually, use the information in this method. Method: Clear prior activation information manually
Remove office license cmd download#
To remove Workplace Joined accounts: download WPJCleanUp.zip, extract the WPJCleanUp folder, and run WPJCleanUp.cmd.If you save signoutofwamaccounts.ps1 in the same location as OLicenseCleanup.vbs, then it will be executed automatically when you run OLicenseCleanup.vbs. To clear the WAM accounts on the device that are associated with Office: download the signoutofwamaccounts.zip file, extract, and run the signoutofwamaccounts.ps1 script with elevated permissions.To remove previous licenses and cached account information: download the OLicenseCleanup.zip file, extract the OLicenseCleanup.vbs script, and run it using elevated permissions.Use the “Select if using automated scripts” link to navigate back to this method. For details about the specific steps that each script automates, select the associated Details link. We recommend that you run the OLicenseCleanup.vbs and signoutofwamaccounts.ps1 scripts listed below, while WPJCleanUp.cmd is required only if your device is Workplace Joined. Run the following scripts that automate each section of the process. Download the Assistant Method: Use scripts to automate the cleanup process
