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
#requires -module ActiveDirectory | |
# Input computers. | |
$threshold = (Get-Date).AddDays(-180) | |
$computers = Get-ADComputer -Filter { OperatingSystem -notlike "*server*" -and OperatingSystem -like "*windows*" -and PasswordLastSet -gt $threshold } | | |
Select-Object -ExpandProperty Name | | |
Sort-Object -Property Name | |
# Make sure there are not existing jobs. | |
Get-Job | |