Solved

adfind syntax lastlogontimestamp

Posted on 2014-03-26
3
401 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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

This article runs through the process of deploying a single EXE application selectively to a group of user.
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 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