Get-ADUser lastLogonTimestamp is reporting blank


hey guys,

i'm looking list of users , last login, in it's simplest form i'm trying this:

get-aduser -filter * -searchbase 'cn=users,dc=domain,dc=com,dc=au' -properties name,lastlogontimestamp | select name,lastlogontimestamp | out-gridview

which works in way, problem of 'lastlogintimestamp' properties empty. if go through ad explorer (from sysinternals) there value in property.  even if test own user name logs in every day returns blank.

if blank @ problem in script, of them return correct value.

is there i'm missing?


hey guys,

i'm looking list of users , last login, in it's simplest form i'm trying this:

get-aduser -filter * -searchbase 'cn=users,dc=domain,dc=com,dc=au' -properties name,lastlogontimestamp | select name,lastlogontimestamp | out-gridview

which works in way, problem of 'lastlogintimestamp' properties empty. if go through ad explorer (from sysinternals) there value in property.  even if test own user name logs in every day returns blank.

if blank @ problem in script, of them return correct value.

is there i'm missing?

got few ideas, though chris doing great job of walking through primary troubleshooting path.

first.  try targeting different ad servers in domain see if different results (the -server parameter of get-aduser, or use repadmin: repadmin /showattr * /subtree /filter:"(&(objectcategory=person)(objectclass=user))" /attrs:lastlogontimestamp > lastlogontimestamp.txt).  if different results, have replication issue.

second: check lastlogontimestamp logging hasn't been disabled using msds-logontimesyncinterval adsiedit.msc or similar tool.  default value 14, reasonable number (it's in days) should work - 0 disables it.  "not set" okay, use default value.

more info: http://blogs.technet.com/b/askds/archive/2009/04/15/the-lastlogontimestamp-attribute-what-it-was-designed-for-and-how-it-works.aspx



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

server manager error: ADAM.events.xml could not be enumerated.

Cannot access Anywhere Access using domain name?

WMI Failure: Unable to update Local Resource Group