Open flukes86 opened 3 years ago
Feel free to add this and create a pull request and we'll merge it. Many thanks
Can be done directly with a filter (and also on groups!)
$DateCutOff = ((Get-Date).AddDays(-30)).Date
$newUsers = Get-ADUser -Filter {whenCreated -ge $DateCutOff} -Properties whenCreated | select whenCreated,SamAccountName
$newGroups = Get-ADGroup -Filter {whenCreated -ge $DateCutOff} -Properties whenCreated | select whenCreated,SamAccountName
Hi, thanks for sharing. I was wondering whether you could add something to identify newly created accounts to the effects of:
$DateCutOff = (Get-Date).AddDays(-30) Get-ADUser -Filter * -Properties whenCreated | where {$_.whenCreated -gt $DateCufOff} | FT Name, whenCreated