Set-WssReportEmailSetting

Set-WssReportEmailSetting

Configures the email settings of health report.

Syntax

Parameter Set: Enable
Set-WssReportEmailSetting -Enable -From <String> -Port <Int32> -SmtpServer <String> -To <String> [-Credential <PSCredential> ] [-UseAuthentication] [-UseSsl] [ <CommonParameters>]

Parameter Set: Disable
Set-WssReportEmailSetting -Disable [ <CommonParameters>]

Detailed Description

The Set-WssReportEmailSetting cmdlet configures the email settings of a health report.

Parameters

-Credential<PSCredential>

Specifies a credential for SMTP authentication. To obtain a credential object, use the Get-Credential cmdlet.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Disable

Indicates that the email setting is disabled.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Enable

Indicates that the email setting is enabled.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-From<String>

Specifies the sender address of the health report. The sender of the email is the email address that you specify.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Port<Int32>

Specifies the TCP port number of SMTP service. The SMTP service listens on the port you specify.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SmtpServer<String>

Specifies the SMTP server name.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-To<String>

Specifies the email addresses of recipients, separated by a semicolon (;). The recipients of the email are the email addresses that you specify.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UseAuthentication

Indicates that the SMTP server requires authentication.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-UseSsl

Use this when SSL is required.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • System.Management.Automation.PSCredential,System.Management.Automation.SwitchParameter,System.Management.Automation.SwitchParameter,System.String,System.Int32,System.String,System.String,System.Management.Automation.SwitchParameter,System.Management.Automation.SwitchParameter

    Email settings

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Set report email settings

The first command creates a $UserName variable.

The second command creates a password for the user by using a secure string conversion cmdlet.

The third command creates a credential for the user by using the New-Object cmdlet.

The last command sets the report email settings.

PS C:\> $UserName = "ContosoUser"
PS C:\> $Password = ConvertTo-SecureString "passw0rd" -AsPlainText -Force
PS C:\> $Cred = New-Object System.Management.Automation.PSCredential($UserName, $Password)
PS C:\> Set-WssReportEmailSetting -Enable -From "Contoso-Admin@contoso.com" -SMTPServer "smtphost" -Port 25 -UseAuthentication -Credential $Cred

Get-WssReportEmailSetting