For user objects:

# Let’s see all the new user accounts created one month ago

$When = ((Get-Date).AddDays(-30)).Date

Get-ADUser -Filter {whenCreated -ge $When} -Properties whenCreated

Get-ADUser -Filter {whenCreated -ge $When} -Properties whenCreated | select samaccountname,whencreated | ft -autosize

# Let’s see all the new user accounts created since the 1st of the month

$When = ((Get-Date)).Date

Get-ADUser -Filter {whenCreated -ge $When} -Properties whenCreated | select samaccountname,whencreated | ft -autosize

For computer objects:

# Let’s see all the new computer created one month ago

$When = ((Get-Date).AddDays(-30)).Date

Get-ADGroup -Filter {whenChanged -ge $When} -Properties whenChanged

 

With Quest cmdlets for AD:

# Let’s see all the new user accounts created today

$When = ((Get-Date)).Date

Get-QADUser -CreatedOn $When | select samaccountname,whencreated | ft -autosize

# Let’s see all the new user accounts created since the 1st of the month

Get-QADUser -CreatedAfter “April 1, 2009”

# Can narrow it down to specific OU to exclude service accounts

Get-QADUser -CreatedAfter “April 1, 2009” -SearchRoot mydomain.local/employees

# Same thing for groups, computers, OUs, or any AD objects

Get-QADComputer -CreatedAfter “April 1, 2009”

Get-QADGroup -CreatedAfter “April 1, 2009”

# Did we hire anyone today?

Get-QADUser -CreatedOn “April 17, 2009”

# Let’s if we have anyone who is with the company for more than 10 years😉

Get-QADUser -CreatedBefore (Get-Date).AddYears(-10) -SearchRoot d.local/emp -Enabled

# Let’s count how many employees we were hiring monthly for

($d = Get-Date “January 1, 2008”; $d -le (Get-Date); $d = $d.AddMonths(1)) { “$($d.ToShortDateString()) to $($d.AddMonths(1).ToShortDateString()):” (Get-QADUser -CreatedAfter $d -CreatedBefore $d.AddMonths(1)).Count }