Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account created dates #17

Open
flukes86 opened this issue Nov 12, 2021 · 3 comments
Open

Account created dates #17

flukes86 opened this issue Nov 12, 2021 · 3 comments

Comments

@flukes86
Copy link

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

@phillips321
Copy link
Owner

Feel free to add this and create a pull request and we'll merge it. Many thanks

@Cool34000
Copy link
Contributor

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

@Cool34000
Copy link
Contributor

#21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants