Forum Discussion
microchipmatt
Apr 21, 2021Copper Contributor
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.
- farismalaebSteel Contributor$date=[datetime]::Today.AddDays(-1)
Get-ADUser -Properties WhenCreated -Filter 'WhenCreated -ge $Date'
If this answer helped, PLease click on Best response.- microchipmattCopper Contributor
farismalaeb does -ge stand for get enabled? If so, Interesting, I will try this 🙂
- microchipmattCopper ContributorI'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.