Set-WssReportEmailSetting
Configures the email settings of health report.
Syntax
Set-WssReportEmailSetting
[-Enable]
-From <String>
-To <String>
-SmtpServer <String>
-Port <Int32>
[-UseSsl]
[-UseAuthentication]
[-Credential <PSCredential>]
[<CommonParameters>]
Set-WssReportEmailSetting
[-Disable]
[<CommonParameters>]
Description
The Set-WssReportEmailSetting cmdlet configures the email settings of a health report.
Examples
Example 1: Set 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
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.
Parameters
-Credential
Specifies a credential for SMTP authentication. To obtain a credential object, use the Get-Credential cmdlet.
Type: | PSCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Disable
Indicates that the email setting is disabled.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Enable
Indicates that the email setting is enabled.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-From
Specifies the sender address of the health report. The sender of the email is the email address that you specify.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Port
Specifies the TCP port number of SMTP service. The SMTP service listens on the port you specify.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SmtpServer
Specifies the SMTP server name.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-To
Specifies the email addresses of recipients, separated by a semicolon (;). The recipients of the email are the email addresses that you specify.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UseAuthentication
Indicates that the SMTP server requires authentication.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UseSsl
Use this when SSL is required.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
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
Related Links
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for