Advertisement
Guest User

Untitled

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