---
title: How to use the MDaemon or SecurityGateway Let's Encrypt script when a space exists in the directory path
description: Use the syntax below to generate a Let's Encrypt certificate when a space exists in the MDaemon or SecurityGateway directory path.
---

[Skip to content](https://knowledge.mdaemon.com/how-to-use-mdaemons-lets-encrypt-script-when-a-space-exists-in-the-mdaemon-directory-path#main-content)

[![](https://knowledge.mdaemon.com/hs-fs/hubfs/MDaemon-Technologies_logo.png?width=200&height=150&name=MDaemon-Technologies_logo.png)](https://mdaemon.com/)

- [Knowledge Base Home](https://knowledge.mdaemon.com/)
- [Go to www.mdaemon.com](https://mdaemon.com/)

Open main navigation

Close main navigation

- [Knowledge Base Home](https://knowledge.mdaemon.com/)
- [Go to www.mdaemon.com](https://mdaemon.com/)
- [Contact Us](https://mdaemon.com/pages/contact-us)

[Contact Us](https://mdaemon.com/pages/contact-us)

 Knowledge Base

- There are no suggestions because the search field is empty.

1. [Knowledge Base Home](https://knowledge.mdaemon.com/?hsLang=en)
2. [MDaemon Email Server](https://knowledge.mdaemon.com/mdaemon-email-server?hsLang=en)

# How to use the MDaemon or SecurityGateway Let's Encrypt script when a space exists in the directory path

## Use the syntax below to generate a Let's Encrypt certificate when a space exists in the MDaemon or SecurityGateway directory path.

This process requires the Let's Encrypt script to be ran manually.  A Windows task can be created using the Windows Task Scheduler to automatically run the command before the certificate expires.

Open a command prompt and navigate to the LetsEncrypt folder in the directory where the software was installed.

- Example: C:\\Program Files\\MDaemon\\LetsEncrypt\>

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 **

Find the directory path for powershell.exe.

- Example: C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe

The command would resemble as follows if ran from this directory.

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

- [MDaemon Email Server](https://knowledge.mdaemon.com/mdaemon-email-server?hsLang=en#main-content)

    - [Mobile Device Management](https://knowledge.mdaemon.com/mdaemon-email-server?hsLang=en#mobile-device-management)
- [MDaemon AntiVirus (SecurityPlus)](https://knowledge.mdaemon.com/mdaemon-antivirus-securityplus?hsLang=en)
- [ActiveSync for MDaemon](https://knowledge.mdaemon.com/activesync-for-mdaemon?hsLang=en)
- [MDaemon Connector for Outlook (Outlook Connector)](https://knowledge.mdaemon.com/mdaemon-connector-for-outlook-outlook-connector?hsLang=en)
- [SecurityGateway for Email Servers](https://knowledge.mdaemon.com/securitygateway-for-email-servers?hsLang=en)
- [RelayFax Network Software](https://knowledge.mdaemon.com/relayfax-network-software?hsLang=en)

[![Chill listening crop-3](https://knowledge.mdaemon.com/hs-fs/hubfs/belch.io/template-assets/MDaemon-Technologies_logo.png?width=199&height=41&name=MDaemon-Technologies_logo.png "Chill listening crop-3")](https://www.mdaemon.com)

[Knowledge Base Home](https://knowledge.mdaemon.com?hsLang=en)

<https://www.youtube.com/c/MDaemonTechnologies> <https://www.linkedin.com/company/mdaemon-technologies/> <https://www.facebook.com/MDaemon.Technologies/> <https://www.twitter.com/MDaemon_Email>

Copyright © 2025, MDaemon Technologies