Solved

adfind syntax lastlogontimestamp

Posted on 2014-03-26
3
381 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
3 Comments
 
LVL 3

Author Comment

by:pma111
Comment Utility
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 35

Assisted Solution

by:Mahesh
Mahesh earned 250 total points
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Remote Apps is a feature in server 2008 which allows users to run applications off Remote Desktop Servers without having to log into them to run the applications.  The user can either have a desktop shortcut installed or go through the web portal to…
Trying to figure out group policy inheritance and which settings apply where can be a chore.  Here's a very simple summary I've written which might help.  Keep in mind, this is just a high-level conceptual overview where I try to avoid getting bogge…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
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 …

763 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

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now