This PowerShell Script will give you an output that shows the Active Directory User logon report. The output would have details of the type of login (remote or local), the date, status of login (failed or successful login), username, workstation name and the IP from where they have logged in
Syntax
# Find DC list from Active Directory
$DCs = Get-ADDomainController -Filter *
# Define time for report (default is 1 day)
$startDate = (get-date).AddDays(-1)
# Store successful logon events from security logs with the specified dates and workstation/IP in an array
foreach ($DC in $DCs){
Download Full Script
Login type: remote logon or local logon
Date:
Status: success for failure.
User name:
Workstation name:
IP address:
Purpose: | To check AD User Logons |
Modification: | NA |
Type: | PowerShell (.ps1) |
Compatibility: | Run with PowerShell |
Tags: | AD, Active Directory, User Logon Report |
Reference link: |