How to script move computer to different ou after getting lastlogondate


get-adcomputer -filter * -properties lastlogondate -searchbase "domain" |       { $_.lastlogondate -lt (get-date).addmonths(-3) } | set-adcomputer -enabled $false

can finish off me? goes ahead , finds computers haven't logged in 3 months , disables it. need script move computers different ou. thanks!

check out:

http://blogs.technet.com/b/heyscriptingguy/archive/2012/03/01/the-easy-way-to-use-powershell-to-move-computer-accounts.aspx



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Edit Group Policy

Hyper-V VM not reaching OS 'Logon' screen

DNS question...