Last active
August 30, 2023 15:06
-
-
Save nopslider/7a6136ab78dbda2a5819 to your computer and use it in GitHub Desktop.
Find enabled users in a specified AD group with PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ADGroup -Filter {(name -like "*admins*") -or (name -like "*administrator*")} ` | |
| Get-ADGroupMember -Recursive | Where { $_.objectClass -eq "user" } ` | |
| Get-ADUser -properties * | where {$_.enabled -eq $true} ` | |
| where {$_.lockedout -eq $false} | select SamAccountName -unique |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!