Windows 2008 doesn’t have SMTP as part of IIS any more. It’s only kept around by shipping the IIS 6 libraries with it, which means it’s managed by the old IIS 6 utilities. We installed SMTP so that our web servers had a relaying agent so if there were any delays talking to the main SMTP server the app wouldn’t crash out. The problem is, the default setting is for the SMTP service to be set to a manual startup, rather than Automatic. This is easily remedied by going through the services management utilities, or powershell one liner…
This is actually 3 steps. The first step connects to WMI and fetches all the services. The second limits the scope to just services with SMTP in the name. And the third is using the returned object and changing settings.
When run, a buunch of data is returned telling to the state of the command:
1 2 3 4 5 6 7 8 9 10 11
You can verify that the command worked properly by looking at the ReturnValue, or by running the command again, but without the set step…
1 2 3 4 5 6
Running this command on a 2008 server is about 10 times faster than waiting for the services utility to open.