logo
search
Microsoft 365 Migration

Fix Register-SPMTMigration ActiveX Apartment State Error in PowerShell

Natalie TaylorNatalie Taylor Sep 27, 2026 869 views

Question details

The user needs to resolve an ActiveX apartment state error when running the Register-SPMTMigration PowerShell command.

How to Fix Register-SPMTMigration ActiveX Apartment State Error
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).
Before you start

Verify that you have administrative privileges in your PowerShell environment and ensure your SharePoint Migration Tool (SPMT) is updated to the latest version.

Solution 1Recommended

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.

1
Open Run dialog

Press the Windows Key + R on your keyboard to open the Run dialog box.

2
Launch PowerShell in STA mode

Type 'powershell.exe -STA' into the run box and press Enter. This forces the new PowerShell session to run in a single-threaded apartment.

3
Execute the migration command

Run your Register-SPMTMigration script or command again within this new STA-enabled PowerShell window.

Run PowerShell in Single-Threaded Apartment (STA) Mode
Script Execution: If you are running a .ps1 script from an automated task, make sure to add the '-STA' parameter to your execution arguments.
Free Microsoft Office alternative

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. 1. Download the installer: Visit the official WPS Office website and click the free download button for your operating system.
  2. 2. Install the software: Run the downloaded installation package and follow the on-screen setup instructions.
  3. 3. Start creating: Open WPS Office and seamlessly edit your existing Word, Excel, and PowerPoint documents.
Seamlessly compatible with Microsoft Office formats including .docx, .xlsx, and .pptx.Lightweight architecture that runs smoothly without slowing down your system.Familiar user interface requiring zero learning curve for migrating teams.Built-in PDF editing tools available completely free of charge.
microsoft office alternative - wps office

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.