• Recent
  • Popular
  • Unsolved
  • Categories
  • Tags
  • Chat
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
SysAdmins Zone Logo

{Pro-Active} Account lockouts alert

Scheduled Pinned Locked Moved Scripts
1 Posts 1 Posters 15 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • katosK Offline
    katosK Offline
    katos Admin
    wrote on last edited by tankerkiller125
    #1

    We use a similar script to the below to alert of account lockouts so that the helpdesk can provide pro-active support for users, this drastically increased our user satisfaction in our latest IT Forums, and allows us to catch issues before they become worse (emails failing to send, case management system lockouts, etc.)

    # Email into the helpdesk to alert pro-actively of any account lockouts
    
    Start-Transcript -path "c:\lockoutlog.txt" -append
    
    $AccountLockOutEvent = Get-EventLog -LogName "Security" -InstanceID 4740 -Newest 1
    $LockedAccount = $($AccountLockOutEvent.ReplacementStrings[0])
    $AccountLockOutEventTime = $AccountLockOutEvent.TimeGenerated.ToLongDateString() + " " + $AccountLockOutEvent.TimeGenerated.ToLongTimeString()
    $AccountLockOutEventMessage = $AccountLockOutEvent.Message
    
    if ( $LockedAccount -ne "Guest" )
    { send-mailmessage $email
    }
    Stop-Transcript
    
    1 Reply Last reply
    👍
    0

© Copyright 2023, SysAdmins Zone.
Terms of Service | Privacy Policy
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Recent
  • Popular
  • Unsolved
  • Categories
  • Tags
  • Chat
  • Login

  • Don't have an account? Register

  • Login or register to search.