Solved

adfind syntax lastlogontimestamp

Posted on 2014-03-26
3
404 Views
Last Modified: 2014-04-08
I am new to the adfind utility, I need a report to list username, lastlogon, lastlogontimestamp, accountstatus (i.e. disabled or enabled). can anyone give me the exact syntax for such a report? If there are any limits on the amount of results the tools prdodcues, I need the limit turning off as there will be several hundred accounts.
0
Comment
Question by:pma111
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Author Comment

by:pma111
ID: 39955632
and also -- do you need domain admin rights to get a full report? or can a basic domain user typically get all the information in the above report?
0
 
LVL 37

Assisted Solution

by:Mahesh
Mahesh earned 250 total points
ID: 39955647
I am not much familiar with ADFind

However I'd get the required info by below tool

Bulk AD users

The tool is freeware and can provide you info about all user attributes

In tool there is option called "properties to load" where you can put up practically any user attribute and then can export results to csv

The tool can be used on any domain controllers from 2003 to 2012

The standard user can fetch all info, but he cannot make any changes

Mahesh.
0
 
LVL 2

Accepted Solution

by:
allen_rich earned 250 total points
ID: 39958198
Try the below command:

Get-ADUser -Filter * -SearchBase "ou=users,dc=contoso,dc=local" -ResultPageSize 0 -Prop CN,samaccountname,lastLogonTimestamp | Select CN,samaccountname,@{n="lastLogonDate";e={[datetime]::FromFileTime($_.lastLogonTimestamp)}} | Export-CSV -NoType last.csv

so if you want to view things like Disabled or Enabled. so for instance,

If ($status.Enabled)
{
  $obj | Add-Property -MemberType NoteProperty -Name UserStatus - Value "Enabled"
}
Else
{
  $obj | Add-Property -MemberType NoteProperty -Name UserStatus - Value "Disabled"
}
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question