Skip to content

Instantly share code, notes, and snippets.

@jhamilton09
Created January 29, 2016 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhamilton09/cbf3b5ef6279b31fc5d0 to your computer and use it in GitHub Desktop.
Save jhamilton09/cbf3b5ef6279b31fc5d0 to your computer and use it in GitHub Desktop.
# Get AD computers where attribute is not null
$PCs = Get-ADComputer -Filter {ms-Mcs-AdmPwd -like "*"} -Properties Name, ms-Mcs-AdmPwd, ms-Mcs-AdmPwdExpirationTime | sort Name | ft Name, ms-Mcs-AdmPwd, ms-Mcs-AdmPwdExpirationTime
$PCs
Write-Host $PCs.count "Computers with LAPS enabled"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment