Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- If (($daystoexpire -ge "0") -and ($daystoexpire -lt $expireindays))
- {
- "$Date - INFO: Sending expiry notice email to $Name" | Out-File ($DirPath + "\" + "LocalPWLog.txt") -Append
- Write-Host "Sending Password expiry email to $name. Password expiring in $daystoexpire days" -ForegroundColor Yellow
- $EmailParams = @{
- SmtpServer = $SMTPHost
- Port = 587
- UseSsl = $true
- Credential = $cred
- From = $FromEmail
- To = $emailaddress
- Subject = 'Your password will expire $daystoexpire days'
- Body = "Dear $Name,
- Your Domain password will expire in $daystoexpire days. Please change it as soon as possible.
- To change your password, follow the method below:
- 1. On your Windows computer
- a. If you are not in the office, logon and connect to VPN.
- b. Log onto your computer as usual and make sure you are connected to the internet.
- c. Press Ctrl-Alt-Del and click on ""Change Password"".
- d. Fill in your old password and set a new password. See the password requirements below.
- e. Press OK to return to your desktop.
- The new password must meet the minimum requirements set forth in our corporate policies including:
- 1. It must be at least 8 characters long.
- 2. It must contain at least one character from 3 of the 4 following groups of characters:
- a. Uppercase letters (A-Z)
- b. Lowercase letters (a-z)
- c. Numbers (0-9)
- d. Symbols (!@#$%^&*...)
- 3. It cannot match any of your past 24 passwords.
- 4. It cannot contain characters which match 3 or more consecutive characters of your username.
- 5. You cannot change your password more often than once in a 24 hour period.
- If you have any questions please contact our Support team at support@thelazyadministrator.com or call us at 555.555.5555
- Thanks,
- The Lazy Administrator
- support@thelazyadministrator.com
- 555.555.5555"
- }
- Write-Host "Sending E-mail to $emailaddress..." -ForegroundColor Green
- Try
- {
- Send-MailMessage @EmailParams
- }
- Catch
- {
- $_ | Out-File ($DirPath + "\" + "Log.txt") -Append
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement