How to list AD deleted objects

January 3, 2013

Check for all deleted AD objects that can be recovered from AD eventually.

cls
Import-Module activedirectory
Get-ADObject –SearchBase “CN=Deleted Objects,DC=domain,DC=local” `
–ldapFilter “(objectClass=*)” -includeDeletedObjects | `
Format-List Name,ObjectClass,ObjectGuid,Sid 

The output looks like this :

image


How to list AD object creation date

January 3, 2013

How to find an user or group object’s creation date in AD.

CLS
Import-Module -Name ActiveDirectory 
$week = (Get-Date).AddDays(-15)
Get-ADUser -Filter * -Properties * | where { $_.whenCreated -ge $week } | `
select Name,whenCreated

It will list this kind of output


image