daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top