Get a list of active users which have logged on to the domain in the last 7 days

Get a list of active users which have logged on to the domain in the last 7 days

# Get a list of users which have logged on to the domain in the last 7 days

$Date = (Get-Date).AddDays(-7)

Get-ADUser -Filter {LastLogonDate -gt $Date} | Select distinguishedName

 

Steve

Comments are closed.