Guest User

Untitled

a guest
Sep 14th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. # Display all Users within Active Directory that have been created in the last 30 days
  2.  
  3. Import-module activedirectory
  4.  
  5. $date = get-date
  6.  
  7. $User = Get-ADUser -Filter 'objectclass -eq "User"' -Properties *
  8.  
  9. $User | Where-Object {$_.whencreated -gt $date.adddays(-30)} |
  10.  
  11. Sort-Object -Property whencreated |
  12.  
  13. Select samaccountname,whencreated,LastLogonDate,Enabled
Add Comment
Please, Sign In to add comment