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
Solved

Last Logon field is blank in Active Directory CSVDE Export

Posted on 2014-09-30
3
1,236 Views
Last Modified: 2014-10-06
Hi All,

I have a quick question surrounding an Active Directory export that I have been given from a customer's AD environment.

In quite a few records the lastLogon field is empty but the pwdlastset date has a recent entry.

I dont understand how the lastlogon is blank when there is an entry in the pwdlast set field

Would anyone have any ideas?

TJ
0
Comment
Question by:tjoconnor
  • 2
3 Comments
 
LVL 8

Expert Comment

by:Acosta Technology Services
ID: 40352063
It's likely a problem with the script used to perform the export.  I would try the following and see if some of those "blank" users come back with lastlogon results:

get-aduser -filter * -properties lastLogonTimestamp | select name, lastLogonTimestamp |export-csv "output.csv"
0
 

Author Comment

by:tjoconnor
ID: 40352125
Hi Operationnos, thanks for your reply.

Below is the command I used. I believe you are using lastLogonTimestamp whereas I used LastLogon. Would that be the potential reason for this, as I recently learned that 'lastLogonTimestamp' is replicated among all DC's and 'LastLogon' is only present on the DC that you authenticate with.

But ultimately is there a reason why the lastlogon would be blank and pwdlastset would be populated?

CSVDE -f adexport.csv -r objectClass=computer -l DN,cn,objectClass,lastLogon,pwdLastSet,userAccountControl,operatingSystem,operatingSystemVersion,description –u
0
 
LVL 8

Accepted Solution

by:
Acosta Technology Services earned 500 total points
ID: 40352132
I believe you are right on the money.  "pwdlastset" would be available from all DC's, while "lastlogon" would only show the results from the DC that the user was authenticated against.  Using "lastlogontimestamp" should provide you the information you're looking for.  Another option would be to query all DC's for "lastlogon" and then merge the data into a single file; using that data you would also have logon location.
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

Last week, our Skyport webinar on “How to secure your Active Directory” (https://www.experts-exchange.com/videos/5810/Webinar-Is-Your-Active-Directory-as-Secure-as-You-Think.html?cid=Gene_Skyport) provided 218 attendees with a step-by-step guide for…
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

829 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