• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 417
  • Last Modified:

adfind syntax lastlogontimestamp

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
pma111
Asked:
pma111
2 Solutions
 
pma111Author Commented:
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
 
MaheshArchitectCommented:
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
 
allen_richCommented:
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

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now