Active Directory True Last Logon based on LastLogon

If you are an IT administrator and need to determine the last time a user used their Active Directory domain user account to logon, also commonly referred to as True Last Logon, you will need to read the value of the lastLogon attribute on domain user and computer accounts.

 

The problem however is that this attribute is not a replicated attribute and thus in order to do so, you will need to query each Domain Controller in the domain for the local lastLogon value on the user's account, then compare each of these values to determine the latest one, and report that as the user's true last logon time.

 

Thus there are two steps to determining the True Last Logon Time in Active Directory of a domain user account. The first step involves obtaining the value from each DC in the domain, and the second step involves comparing these values (taking into account Integer8 syntax) to arrive at the true last logon value for the user.

 

You could either write your own scripts to determine the True Last Logon value for user accounts, or use 3rd party scripts (often untested or unreliable though). Alternatively, you could use 3rd party tools to generate Last Logon reports.

 

For additional information, you can read this helpful article on True Last Logon over at the Active Directory Security dot com website.

What is delegation of administration in Active Directory?

An IT infrastructure is typically comprised of many IT assets such as user accounts, computers, files and databases, applications and services all of which need to be administered. In such IT infrastructures, it is not possible for a handful of administrators to adequately administer all aspects of the IT infrastructure.

 

Thus, in most IT infrastructures, administrative responsibilities for managing the various IT assets that together comprise the IT infrastructure are distributed (or delegated) amongst an adequate and typically greater number of less-privileged administrators, who are then responsible for managing smaller specific portions of the IT infrastructure.

 

Delegation of administration is the act of distributing and delegating an administrative task for various aspects of IT management amongst an adequate number of administrators.

 

The act of delegating administration involves granting one or more users or Active Directory security groups the necessary Active Directory security permissions as appropriate so as to able to allow the delegated administrator to carry out these tasks.

 

In the interest of security, after delegating an administrative task, IT personnel should always also verify delegation in Active Directory, so as to be sure that the task was delegated accurately. The process of verifying a delegation in Active Directory is rather complicated but with the right Active Directory Reporting Tool, IT personnel can accomplish this task efficiently and reliably.

 

Done right, Active Directory's powerful administrative delegation capabilities let organizations securely, efficiently and cost-effectively delegate administrative authority for identity and access management in their IT infrastructures thereby reducing cost and enhancing security.

 

Source - Active Directory Security Technical Reference


A Guide to the Active Directory Security Model

Active Directory's security model secures and protects every object stored in Active Directory, including domain user accounts and domain computer accounts, domain security groups and group policies. The Active Directory Security model allows administrators to specify who has what access to which object to a high degree of control. It also allows administrators to specify access for an entire group of users so as to simply security management.

 

The following is an overview of how Active Directory's security model protects stored content –

  1. Each object is protected by a component known as a Security Descriptor

  2. Each security descriptor contains amongs other compronents, an Access Control List (ACL)

  3. Each ACL contains one or more Access Control Entries (ACEs)

  4. Each ACE allows or denies specific security permissions to some security principal

  5. Security groups can be specified and be part of security groups

  6. ACEs can be explicit or inherited; explicit ACEs override inherited ACEs

  7. Access is specified in the form of low–level technical permissions

  8. These low-level permissions can be standard permissions, or special permissions such as extended rights or validated writes

  9. Active Directory's current object visibility mode impacts list access requests

  10. The access check takes into account the object's ACL and the user's token and determines resultant access for user on the object

In this manner, Active Directory's security model secures and protects Active Directory content.


How to Generate True Last Logon Security Reports in Active Directory

As an IT administrator you may need to determine the last time a user used their Active Directory domain user account to logon. For instance, last logon values are required to generate and furnish a list of stale domain user accounts.

 

Active Directory stores the last logon time of a domain user account in a specific attribute on the user object called lastLogon, but this is not a replicated attribute, so IT administrators need to query each DC in the domain for the local lastLogon value on the user's account, then compare each of these values to determine the latest one, and report that as the user's true last logon time. The actual last user logon value is also commonly referred to as True Last Logon. There are two steps to determining the true last logon time of a domain user account. The first step involves obtaining the value from each DC in the domain, and the second step involves comparing these values (taking into account Integer8 syntax) to arrive at the true last logon value for the user.

In order to read the lastLogon attribute, you must have appropriate Active Directory security permissions as well, because without it you will not be able to read the value of this attribute. Fortunately, the security descriptor is replicated so you don't need to worry about the permissions being replicated.

 

There are many Active Directory Reporting Tools that can help IT administrators automatically generate True Last Logon reports. Some of these tools are also available in Free Editions, and can help IT admins instantly fulfill their Active Directory security reporting needs for audit and compliance.

 

True Last Logon reports are essential for security, and can help organizations identity and clean up stale/inactive domain user accounts in their Active Directory. Automated tools provide an advantage over many queries or over semi-automated PowerShell scripts.


How to identify and list recently Deleted Objects in Active Directory?

IT admins often need to be able to identify recently deleted objects in their Active Directory deployments. In certain cases, this might be to uncover accidental deletions, and in other cases, this might be to generate a list of all recently deleted objects for audit or compliance purposes.

An Active Directory object comes into existence either when Active Directory is installed, or when it is created by an IT administrator or an application. When it is no longer needed, an object can be deleted by an IT administrator or an application. When an object is deleted, it is first logically deleted for a specific interval of time to allow replication of the deletion to occur, and after this time has elapsed it is physically deleted.

IT administrators thus often have a need to be able to identify and list recently deleted objects in Active Directory, and there are more than one ways in which IT administrators can enumerate Deleted Objects in Active Directory

IT administrators who wish to query Active Directory to obtain a list of deleted objects should use the Object Identifier Control (1.2.840.113556.1.4.417) also known as the Show Deleted Object control. IT administrators can also choose to use 3rd party automated Active Directory reporting tools that provide instant and reliable reports which document all objects have been deleted in the last few days, often based on their class as well.

It always helps to know if there were any accidental deletions, or if any objects were recently deleted by another IT administrator, so IT administrators should always keep an eye out for deleted objects, and ensure that any accidental deletions are undone.


How to Install and register MSSTDFMT.DLL on your Computer

Sometimes when you try to run a program that is installed on another computer, you may encounter the following (or a similar) error message –
    Run time Error 713. Class not registered. You need the following file to be installed on your machine: MSSTDFMT.DLL.

To solve this problem, you can following these step-by-step instructions on how to install and register this DLL –
  1. Begin by searching for the file MSSTDFMT.DLL file on your computer

  2. Once you have found this file, if it is not already in the C:\Windows directory, move it into this directory

  3. Then, click on Start, select Run and type cmd to open a command prompt

  4. In the command prompt, type regsvr32 "C:\Windows\msstdfmt.dll”

That’s all you need to do. You can now try and re-run your program and it should work fine and no longer give you this error message

Note: I hope you found this post useful. If so, and you too have a blog, or if you Tweet, it would be appreciated if you could kindly add a link to this useful post, so others could benefit from it to. The link is –http://active-direct-reporting.blogspot.com/