How to start SMTP virtualhost [SMTP Virtual Server #1] through powershell or command prompt

7,512

Actual working answer is here:

([ADSI]'IIS://LOCALHOST/SMTPSVC/1').Start()
([ADSI]'IIS://LOCALHOST/SMTPSVC/1').Stop()

From: https://stackoverflow.com/a/37432396/3321505

Share:
7,512

Related videos on Youtube

Elliot Huffman
Author by

Elliot Huffman

I am a self taught computer guru and am proficient in Windows, OS X, Linux, and Cloud. My cert count has exceeded 35 active certs. If you wanna check them out, head on over to acclaim: https://www.youracclaim.com/users/elliot-huffman I used to work at the Microsoft Global Help Desk, which is an international service desk for internal Microsoft employees, vendors and other business guests/contractors. I was also the owner and founder of Elliot Labs LLC, a consulting and services company that focused on Information Technology and Computer Science. It was in operation since late 2011 and serviced a wide range of customers from residential to business. I currently work as a Customer Engineer at Microsoft. I will see you around!

Updated on September 18, 2022

Comments

  • Elliot Huffman
    Elliot Huffman almost 2 years

    Because of some error on my server, my SMTP service [SMTP Virtual Server #1] stops. I want to create job which will run periodically to check the SMTP server status, if it is stopped then the script will start it again.

    I have used Start-Service "SMTPSVC" but it only starts the UATSERV service and not the [SMTP Virtual Server #1] virtual host (please have a look of the attached image).

    How do I start the virtual server after the service is started?

    My admin team is working on the issue. I wanted to use this temporary solution in the mean time.

    Any help is appreciated... :)

    SMTP virtual host image

    • Admin
      Admin almost 10 years
      This doesn't actually work, at least in Windows 2008. It puts a Red X over the SMTP server but telnet tests to port 25 show that its not really working, at least not for me
  • Admin
    Admin over 11 years
    By Mistake you are entered wrong ServerState for START & STOP the SMTP.
  • Admin
    Admin over 11 years
    ServerState 2 For START & ServerState 4 for STOP. Thanks Again....
  • Admin
    Admin almost 7 years
    fyi, this doesn't stop/start the server on windows 2012, it only changes the icon this worked for me: $SMTP=[adsi]"IIS://localhost/SMTPSVC/1" $SMTP.Stop() or .Start()
  • Admin
    Admin over 6 years
    This did not work for me on Windows Server 2008R2. As above, the status appears to change in IIS Manager, but the actual status of the service is not affected.