Configuration File [Smtp] - phbits/WebsiteFailedLogins GitHub Wiki

Only required if using Smtp as an alert method.

[Smtp] To

Recipient email address for the alert.

Example Value

To = [email protected]

[Smtp] From

Sender's email address for the alert.

Example Value

From = [email protected]

[Smtp] Subject

Email subject for the alert. When an alert is generated, the email subject is modified.

Using the Example Value, here is how the email subject will look for each alert.

FailedLoginsPerIP: [FailedLoginsPerIP][1.1.1.1] W3SVC1 Website Failed Logins Alert
TotalFailedLogins: [TotalFailedLogins] W3SVC1 Website Failed Logins Alert
TerminatingError:  [TerminatingError] W3SVC1 Website Failed Logins Alert

Example Value

Subject = W3SVC1 Website Failed Logins Alert

[Smtp] Server

DNS name or IP address of SMTP server.

NOTE: this script is hard-coded to use TLS1.2 when communicating with this server.

Example Value

Server = smtp.domain.com

[Smtp] Port

SMTP server port to connect to.

Example Value

Port = 25

[Smtp] CredentialXml

Optional setting. XML file containing PSCredential for SMTP authentication. Leave blank if no credentials are to be used.

Create CredentialXml File

To create this file run the following command using the account that will be launching this module.

Get-Credential | Export-Clixml -Path <CredentialXmlPath>

Ensure NTFS permissions on the PSCredential xml file are tuned to only allow access to SYSTEM, any backup accounts, and the user running this module. The Export-Clixml cmdlet encrypts credential objects by using the Windows Data Protection API. The encryption ensures that only your user account on only that computer can decrypt the contents of the credential object. The exported CLIXML file can't be used on a different computer or by a different user. For more information: Export-Clixml: Example 3: Encrypt an exported credential object on Windows

Not using Credentials

To not use smtp credentials, leave this setting blank as shown in the example below.

Example Values

CredentialXml = D:\Tools\WebsiteFailedLogins-Smtp-Credentials.xml
CredentialXml =