2025-10-24

Fix: SMTP Service MMC has detected an error in a snap-in

When right-click on [SMTP Virtual Server #1] in IIS 6.0 Manager and SMTP Server, you may get this error:

"MMC has detected an error in a snap-in. It is recommended that you shut down and restart MMC."

Here's the fix:

  1. Stop SMTPSVC service [Display Name: Simple Mail Transfer Protocol (SMTP)]
  2. Stop IISADMIN service [Display name: IIS Admin Service]
  3. Edit "C:\Windows\System32\inetsrv\MetaBase.xml"
  4. Find: <IIsSmtpServer Location ="/LM/SmtpSvc/1"
  5. Add (Settings are alphabetical): RelayIpList=""
  6. Save file
  7. Start IISAdmin Service
  8. Start SMTPSVC service

以下提供 PowerShell 程式,直接執行完成上述步驟

Stop-Service -Name SMTPSVC -Force
Stop-Service -Name IISADMIN -Force

$metaBasePath = "C:\Windows\System32\inetsrv\MetaBase.xml"
[xml]$xml = Get-Content $metaBasePath
foreach ($node in $xml.configuration.MBProperty.IIsSmtpServer) {
    if (-not $node.RelayIpList) {
        $node.SetAttribute("RelayIpList", "")
    }
}

$xml.Save($metaBasePath)
Start-Service -Name IISADMIN
Start-Service -Name SMTPSVC


沒有留言:

張貼留言