Fix Register-SPMTMigration ActiveX Apartment State Error in PowerShell
Question details
The user needs to resolve an ActiveX apartment state error when running the Register-SPMTMigration PowerShell command.

- Product
- SharePoint Migration Tool (SPMT)
- Device & OS
- not provided
- Scenario
- Executing a PowerShell command to manage Microsoft 365 SharePoint migrations.
- Observed behavior
- The Register-SPMTMigration command fails with an error indicating that the current PowerShell thread is not in a single-threaded apartment (STA).
Verify that you have administrative privileges in your PowerShell environment and ensure your SharePoint Migration Tool (SPMT) is updated to the latest version.
Run PowerShell in Single-Threaded Apartment (STA) Mode
Launch your PowerShell session in STA mode to satisfy the ActiveX control requirements of the SPMT module.
The Register-SPMTMigration command relies on ActiveX components that require a Single-Threaded Apartment execution model. By explicitly starting PowerShell with the STA switch, you can prevent this thread state error.
Press the Windows Key + R on your keyboard to open the Run dialog box.
Type 'powershell.exe -STA' into the run box and press Enter. This forces the new PowerShell session to run in a single-threaded apartment.
Run your Register-SPMTMigration script or command again within this new STA-enabled PowerShell window.

Seek Developer Assistance on Microsoft Q&A
If running in STA mode does not resolve the module conflict, consult the Microsoft developer community with your script parameters.
Switch to WPS Office for a Lightweight Document Experience
While you handle complex Microsoft 365 migrations, consider adopting WPS Office as a fast, resource-friendly daily productivity suite for your document needs.
- 1. Download the installer: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install the software: Run the downloaded installation package and follow the on-screen setup instructions.
- 3. Start creating: Open WPS Office and seamlessly edit your existing Word, Excel, and PowerPoint documents.

Frequently Asked Questions
Why does Register-SPMTMigration require a single-threaded apartment?
The Register-SPMTMigration command utilizes underlying ActiveX controls designed to operate in a Single-Threaded Apartment (STA) model. Standard PowerShell sessions sometimes default to Multi-Threaded Apartment (MTA), causing the component to fail.
Does this ActiveX error happen in PowerShell 7 as well?
Yes, the ActiveX apartment state error has been reported in both PowerShell 5 and PowerShell 7. Explicitly launching the session with the -STA parameter usually resolves the issue in both versions.
Where can I find the SharePoint Migration Tool error logs?
SPMT logs are typically stored in your local user profile directory under AppData\Roaming\Microsoft\MigrationTool. Reviewing these text files can provide additional context if your command continues to fail.




