Friday, January 23, 2009

Get-QADComputer Lastlogintime

=========

also switched lastLogonTimeStamp with pwdLastSet
Re: Get-QADComputer Lastlogintime
Posted: Dec 16, 2008 7:29 AM in response to: alex.stefishen@...
Answered
Reply

Sure. :-)

$limit = (get-date).AddDays(-30).ToFileTime()
$filter = "(&(objectcategory=computer)(|(lastLogonTimestamp<=$limit)(!(lastLogonTimestamp=*))))" $inactivecomputers = Get-QADComputer -ldapFilter $filter -ip lastlogontimestamp -SizeLimit 0 $inactivecomputers | ft name,@{l="LastLogonTimeStamp";e={if($_.lastLogonTimestamp -ne $null){[DateTime]::FromFileTime([Int64]::Parse($_.lastLogonTimestamp))}} } -autosize

No comments: