We recently upgraded to Windows 2008R2 Native Mode. As a result we now have a lot of PowerShell functionality in AD without using the Quest cmdlets. They were great while we needed them but I like having the native functionality.
I blogged about how to do this from the command line using dsquery and dsrm here. That solution works very well, however I have other PS scripts I would like to integrate this with so I did it now natively in PS.
$date = [DateTime]::Today.AddDays(-90); Get-ADComputer -Filter ‘PasswordLastSet -lt $date’ -Properties PasswordLastSet | sort Name | remove-adobject -confirm:$false –Recursive
I pulled this from the PowerShell AD blog I think so I have to give them original credit. I made slight modifications for my environment…





Recent Comments