Help Center/ Server Migration Service/ FAQs/ Agent Installation and Startup/ How Do I Fix the Error "DLL load failed" When I Try to Start the SMS-Agent on a Windows Source Server?
Updated on 2025-07-31 GMT+08:00

How Do I Fix the Error "DLL load failed" When I Try to Start the SMS-Agent on a Windows Source Server?

Symptom

The SMS-Agent.exe program could not start on the Windows source server, and the following error message was displayed: "Failed to execute script 'pyi_rth_pkgres' due to unhandled exception: DLL load failed while importing pyexpat."

Possible Causes

SMS-Agent.exe is an application packaged using Python. It relies on certain OS components of the source server. This error happens if the SMS-Agent in Python 3 installed on the source server cannot find the underlying dynamic link library (DLL) file during the startup.

Solution

Use the SMS-Agent in Python 2 for migration. This version has better compatibility.
  1. Sign in to the SMS console. On the Agents page, select Windows and download the Windows Agent (Python 2) version to the source server.
  2. Log in to the source server as user Administrator and double-click the SMS-Agent-Py2.exe file.
  3. In the installation wizard, click Install. After the installation is complete, click Finish. The program files are automatically decompressed to the installation directory (C:\SMS-Agent-Py2 by default).
  4. Go to the SMS-Agent installation directory C:\SMS-Agent-Py2 and double-click agent-start.exe.
  5. In the displayed CLI, enter the AK/SK pair for the account that owns the target server and the SMS domain name. Typically, the SMS-Agent starts up without issues.