Avatar of Exchange User
Exchange User
 asked on

Issues with AD Logins

Hi all,

I have 2 helpdesk users working with me. None of them are domain admins. One of them sometimes is unable to unlock any user account and the problem disappears once he reboots.

Another one who is logged in to a laptop, iphone and ipad at the same time, gets his account locked for no reason after every few hours. On his Outlook he gets a prompt to put in his password and I check on the ADUC, he is locked.

Any ideas what might be wrong ? I check the Login Audit but couldnt find any solution.

Active DirectoryWindows Server 2008

Avatar of undefined
Last Comment
Exchange User

8/22/2022 - Mon

open up powershell as an administrator
type import-module ActiveDirectory
copy and paste the below at your cursor   (at the first login, log with your domain admin account ex. domain\username)

#Set variables
$progress = 0

#Get Admin Credentials
Function Get-Login {
Write-Host "Please provide admin credentials (for example DOMAIN\admin.user and your password)"
$Global:Credential = Get-Credential

#Get Username to search for
Function Get-Username {
      $Global:Username = Read-Host "Enter username you want to search for"
      if ($Username -eq $null){
            Write-Host "Username cannot be blank, please re-enter username!"
      $UserCheck = Get-ADUser $Username
      if ($UserCheck -eq $null){
            Write-Host "Invalid username, please verify this is the logon id for the account!"

#Get Computername Prefix for large environments
Function Get-Prefix {
      $Global:Prefix = Read-Host "Enter a prefix of Computernames to search on (CXX*) use * as a wildcard or enter * to search on all computers"

#Start search
$computers = Get-ADComputer -Filter {Enabled -eq 'true' -and SamAccountName -like $Prefix}
$CompCount = $Computers.Count
Write-Host "Searching for $Username on $Prefix on $CompCount Computers`n"

#Start main foreach loop, search processes on all computers
foreach ($comp in $computers){
      $Computer = $comp.Name
      $Reply = $null
        $Reply = test-connection $Computer -count 1 -quiet
        if($Reply -eq 'True'){
            if($Computer -eq $env:COMPUTERNAME){
                  #Get explorer.exe processes without credentials parameter if the query is executed on the localhost
                  $proc = gwmi win32_process -ErrorAction SilentlyContinue -computer $Computer -Filter "Name = 'explorer.exe'"
                  #Get explorer.exe processes with credentials for remote hosts
                  $proc = gwmi win32_process -ErrorAction SilentlyContinue -Credential $Credential -computer $Computer -Filter "Name = 'explorer.exe'"
                  #If $proc is empty return msg else search collection of processes for username
                  write-host "Failed to check $Computer!"
                  ForEach ($p in $proc) {                        
                        $temp = ($p.GetOwner()).User
                        Write-Progress -activity "Working..." -status "Status: $progress of $CompCount Computers checked" -PercentComplete (($progress/$Computers.Count)*100)
                        if ($temp -eq $Username){
                        write-host "$Username is logged on $Computer"
write-host "Search done!"

Try using the account lockout tool from Microsoft, it will show where the lockout is being initiated from so you can troubleshoot - https://www.microsoft.com/en-gb/download/details.aspx?id=15201

My gut feeling is that he has a password configured incorrectly on his phone/iPad, if this is the case the lockout tool will show his lockout being generated from the applicable that the devices connect to eg edge transport server
Exchange User

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Exchange User


Can you please tell me what does this script do ?
Your help has saved me hundreds of hours of internet surfing.

You should then be able to see what IP the lockout was initiated from

There seems to be a bug in that script
Exchange User

Problem is still there.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.