Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Powershell to check AD attributes for the last logon user in AD computer ?

Posted on 2016-10-22
2
Medium Priority
?
1,825 Views
Last Modified: 2016-11-10
Hi People,

How can I check the attributes of the computer object and identify the last logged on user.

I can do it manually:

Open AD Users and Computers
Right click the object
Click the attributes tab
*optional* filter for attributes with values
Look for the value:  last logged on user

Thanks in advance,
0
Comment
  • 2
2 Comments
 
LVL 7

Accepted Solution

by:
Niten Kumar earned 2000 total points (awarded by participants)
ID: 41854948
Have a look at this link below:

http://gallery.technet.microsoft.com/scriptcenter/Get-Active-Directory-User-bbcdd771

Assuming you don't have the AD modules, the last program linked on this page (PSLimitedLastlogon.ps1):

http://www.rlmueller.net/Last%20Logon.htm

will document lastLogonTimeStamp for all users specified in an input file (pre-Windows 2000 logon names). The output is comma delimited, just redirect the output to a csv file.
0
 
LVL 7

Expert Comment

by:Niten Kumar
ID: 41881892
Solution provides what is requested in the question
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

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

After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
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…
Loops Section Overview

885 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