How to use MDaemon's Let's Encrypt script to pass multiple host names when a space(s) exists in the MDaemon directory path

Use the syntax below to generate a Let's Encrypt certificate with multiple host names when the MDaemon directory contains any spaces in the path.  This process requires the Let's Encrypt script to be ran manually.  A task can be created using the Windows Task Scheduler to run the command before the certificate expires.

  • Open a command prompt and navigate to the LetsEncrypt folder in the MDaemon directory.
    • Example: C:\Program Files\MDaemon\LetsEncrypt>
  • Find the directory path for powershell.exe.
    • Example: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe

The command must be ran from inside MDaemon's LetsEncrypt folder and should resemble the following;

  • C:\Program Files\MDaemon\LetsEncrypt> C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe .\letsencrypt.ps1 "-alternatehostnames mail1.domain.com,mail2.domain.com" -To "admin@yourdomain.com"
  • OR C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -Command "& 'C:\Program Files\MDaemon\LetsEncrypt\letsencrypt.ps1' -alternatehostnames mail1.domain.com,mail2.domain.com"