Public/Get-LockedADUsers.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#Requires -Modules ActiveDirectory
#Requires -Version 3.0

function Get-LockedADUsers () {
<#
.SYNOPSIS
 Get Locked AD Users Accounts
 
.DESCRIPTION
 Get Locked AD Users Accounts
  
 Requirement:
    - Active Directory PowerShell Module
 
.NOTES
   File Name : Get-LockedADUsers.ps1
   Author : Andriy Zarevych
 
   Find me on :
   * My Blog : https://angry-admin.blogspot.com/
   * LinkedIn : https://linkedin.com/in/zarevych/
   * Github : https://github.com/zarevych
#>


    Search-ADAccount -Lockedout |
    Select-Object Name, SamAccountName, UserPrincipalName, DistinguishedName | Sort-Object Name | Format-Table -AutoSize
    #Select-Object Name, SamAccountName, UserPrincipalName, DistinguishedName #| Sort-Object Name | Format-Table -AutoSize
}