Forum Discussion

microchipmatt's avatar
microchipmatt
Copper Contributor
Apr 21, 2021

PowerShell Command to get a list of Users ENABLED in the last 24hrs in AD

Is there a PowerShell command to query a list of users enabled in the last 24 hrs in AD? I have one for recently created, but need one for User's enabled in the last 24 hours now.  Thanks in advance for any help provided.

  • farismalaeb's avatar
    farismalaeb
    Steel Contributor
    $date=[datetime]::Today.AddDays(-1)
    Get-ADUser -Properties WhenCreated -Filter 'WhenCreated -ge $Date'


    If this answer helped, PLease click on Best response.
      • microchipmatt's avatar
        microchipmatt
        Copper Contributor
        I'm pretty sure this will only query users created in the last 24hrs....I'm looking for a script that will identify any users enabled in the last 24 hrs.

Resources