?
Solved

adfind syntax lastlogontimestamp

Posted on 2014-03-26
3
Medium Priority
?
408 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 1000 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 1000 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Here's a look at newsworthy articles and community happenings during the last month.
Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
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 transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
Suggested Courses

800 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