Here is a little code block for setting the smtp smart host on a server using powershell, changing the local host to your servername.
$SMTPSvc = [ADSI]“IIS://localhost/smtpsvc/1″
$SMTPSvc.SmartHost = “smtp.yourhost.com”
$SMTPSvc.SetInfo()
Here is a little code block for setting the smtp smart host on a server using powershell, changing the local host to your servername.
$SMTPSvc = [ADSI]“IIS://localhost/smtpsvc/1″
$SMTPSvc.SmartHost = “smtp.yourhost.com”
$SMTPSvc.SetInfo()
One of the questions I get from a lot of people is how do you tell what version of PowerShell you are running. The easiest way it to open up PowerShell and type get-host. See the screen shot below. You will see that the second line has the version number. This screen shot shows 3.0 which is the standard PowerShell version for Windows 8.
PowerShell is a great tool for administrating both workstations and servers. If you are new to PowerShell it can be hard to figure out where to start. The easiest thing I found besides just trying commands in the shell is to read about it. TechNet has allot of resources including the Windows PowerShell Cmdlet Help Library. This will give you a good idea of some of the built in cmdlets that are available. Check out the link below and let us know what you think.
TechNet Windows PowerShell Cmdlet Help
http://technet.microsoft.com/en-us/library/dd347701.aspx
Additional Help
Scripting Guy Blog
PowerScripting Podcast