1

Yes, it's all ancient. Yes, not supported. Welp...

What would be the correct way to create an IIS SMTP Virtual Server using command-line tools so that the whole endeavor could be scripted and DevOpsed away in a Git repository?

Here are my unsuccessful attempts thus far (as Administrator, of course):

adsutil create smtpsvc
adsutil create smtpsvc/2
adsutil create smtpsvc/2/root
adsutil create smtpsvc "IisSmtpServer"
adsutil create smtpsvc/2 "IisSmtpServer"
adsutil create smtpsvc/2/root "IisSmtpServer"

and all the variations thereof. All of them failed with one error or another.

Oh, the places I've been to while Googling for answers... But alas, nothing really helped me even create the SMTP Virtual Server.

0

There is no simple command line to create SMTP services. If I would be tasked eith this, I would start with PowerShell like this:

Import-Module ServerManager
Add-WindowsFeature SMTP-Server,Web-Mgmt-Console,WEB-WMI

Then start using WMI:

$virtualSMTPServer = Get-WmiObject IISSmtpServerSetting -namespace “ROOT\MicrosoftIISv2” | Where-Object { $_.name -like “`"SmtpSVC/1" }
$virtualSMTPServer.FullyQualifiedDomainName = "mail.example.com"

[...]
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.