How to find users or object added to AD i.e. the last 48 hours?

How to find users added to AD i.e. the last 48 hours? I have found som PowerShell scripts on the net, but they dont seem to work. It also would be nice to be able to see which objects have been changed the last 48 hours.
Per JacobsenSystem TechnicianAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SilverwolfSenior Server EngineerCommented:
Here is a real simple one.....which I like simple.

$When = ((Get-Date).AddDays(-2)).Date
Get-ADObject -Filter {whenCreated -ge $When} -Properties * | Select Name, WhenCreated, CanonicalName | export-csv C:\Adobjects.csv -notypeinformation
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Shaun VermaakTechnical SpecialistCommented:
Import ActiveDirectory
$changesAfter = (get-date).AddHours(-48)
Get-ADObject -Filter 'whenchanged -gt $changesAfter' | Group-Object objectclass

Open in new window

2
Sara TeasdaleCommented:
Pretty easy with PowerShell:
Powershell

$When = ((Get-Date).AddDays(-30)).Date
Get-ADUser -Filter {whenCreated -ge $When} -Properties whenCreated

Pretty much the same thing for groups:
Powershell

$When = ((Get-Date).AddDays(-30)).Date
Get-ADGroup -Filter {whenChanged -ge $When} -Properties whenChanged


There are some AD audit freeware edition tools out there that are free. Not sure about alerts, but you may be able to do something with task scheduler and event viewer if you audit AD events.

http://www.manageengine.com/products/active-directory-audit/download-free.html

www.netwrix.com/active_directory_auditing.html
1
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Per JacobsenSystem TechnicianAuthor Commented:
The server is a Windows 2008 R2 and it is the DC holding the FSMO roles.

I tried that, but get an error, I may be an PowerShell noob, what am I doing wrong?

PS C:\Users\Administrator.XXXXXX> $When = ((Get-Date).AddDays(-30)).Date
PS C:\Users\Administrator.XXXXXX> Get-ADUser -Filter {whenCreated -ge $When} -Properties whenCreated
The term 'Get-ADUser' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:11
+ Get-ADUser <<<<  -Filter {whenCreated -ge $When} -Properties whenCreated
    + CategoryInfo          : ObjectNotFound: (Get-ADUser:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
0
Shaun VermaakTechnical SpecialistCommented:
You need
Import ActiveDirectory

Open in new window

as per #a42518315
0
Per JacobsenSystem TechnicianAuthor Commented:
I start to feel a little stupid, I just get.:

PS C:\> Import ActiveDirectory
The term 'Import' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spel
ling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:7
+ Import <<<<  ActiveDirectory
    + CategoryInfo          : ObjectNotFound: (Import:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
0
SilverwolfSenior Server EngineerCommented:
It needs to be: import-module ActiveDirectory
0
Shaun VermaakTechnical SpecialistCommented:
Sorry, was typing from memory
1
Naveen SharmaCommented:
Check this article to get a list of Active Directory user accounts created in last 24 hours. In order to get an in-depth view of the changes for answering the who, what, when and where questions of change auditing - configure the Monitoring of AD Objects in Windows Server: https://www.lepide.com/how-to/enable-auditing-of-ad-objects-in-windows-server-2012.html

Else, try Active Directory auditing solution:
https://www.lepide.com/lepideauditor/active-directory-auditing.html
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.