Solved

custom search ad users and computers.

Posted on 2014-03-26
9
346 Views
Last Modified: 2014-04-08
is there anyway in ad users and computers to run a report to list all users (logonname), their status (i.e. disabled/expired/active) and the fields lastlogon and lastlogontimestamp. I thought there may be a way to do it in custom search area of a new query in ADUC, but couldnt find the fields. If I double click a user objecy in ADUC the fields and dates can be found in the attribute editor tab.
 
Any help most welcome. Can it be done in the LDAP query section?
0
Comment
Question by:pma111
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 8

Expert Comment

by:Camy
ID: 39955989
Powershell would probably be the way to do it - what version of Windows Server are you running?
0
 
LVL 14

Accepted Solution

by:
Justin Yeung earned 300 total points
ID: 39956009
This one line powershell command can export the data that you want to get from AD

Import-Module ActiveDirectory
Get-Aduser -Filter * -Properties * | Select-Object Name,SamAccountName,Enabled,AccountExpirationDate,@{Name="LastLogonTimestamp"; Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp)}},@{Name="Lastlgon"; Expression={[DateTime]::FromFileTime($_.lastlogon)}},LastlogonDate | Export-Csv C:\Export.csv

Open in new window

0
 
LVL 3

Author Comment

by:pma111
ID: 39956014
Do you have to download something first before this will work, i.e. the AD module?
0
 
LVL 3

Author Comment

by:pma111
ID: 39956018
2008 - but I wanted to know (as per the question) if it was do-able within ADUC.
0
 
LVL 14

Expert Comment

by:Justin Yeung
ID: 39956036
probably not in ADUC
0
 
LVL 8

Assisted Solution

by:Camy
Camy earned 100 total points
ID: 39956052
Definitley not in ADUC, the columns available for results are limited.
If you are running it from the Domain Controller it should have the AD module (and powershell) available already.
0
 
LVL 3

Author Comment

by:pma111
ID: 39956069
will give the powershell solution a go. many thanks
0
 
LVL 14

Expert Comment

by:Justin Yeung
ID: 39956534
RSAT on workstation or run it directly on a Domain controller which already include Active Directory powershell Module.
0
 
LVL 3

Assisted Solution

by:chuckmccullough
chuckmccullough earned 100 total points
ID: 39960053
You can add to the columns available for display in ADUC using ADSIEdit. Here are a few sites with examples:

http://markparris.co.uk/2011/12/12/add-operating-system-and-service-pack-information-to-active-directory-users-and-computers/

http://pberblog.com/post/2009/06/21/Add-extra-columns-to-Active-Directory-Users-and-Computers-display.aspx

I ran a quick test just now and unfortunately ADUC doesn't produce much for the fields you need for this particular report. The examples provided on the links above might prove useful for future reports, though.

If you aren't comfortable diving into PowerShell as mentioned above, most of the popular GUI utilities out there should give you this report fairly easily. The company I work for has a product called Hyena that allows you to create reports like this by picking and choosing the attributes you want:

http://www.systemtools.com/hyena/
0

Join & Write a Comment

Mapping Drives using Group policy preferences Are you still using old scripts to map your network drives if so this article will show you how to get away for old scripts and move toward Group Policy Preference for mapping them. First things f…
Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
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 from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
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…

762 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

21 Experts available now in Live!

Get 1:1 Help Now