Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

find active users question

$
0
0

I have this code that works.

 

get-aduser -ldapfilter "(&(&(objectCategory=user)(userAccountControl=512)))" | Select sAMAccountName, Enabled, givenname | out-file c:\temp\\users1.csv

 

The problem is it gets ALL active user accounts and due to bad AD management over the past 10 years we have 3,800 active user accounts but only 1,300 people working at our company Big Smile

 

How would I tweak my code to show all active users who have actually logged into AD in the past 100 days?   Note:  I can't look for users who have changed their password since we have no password policy in place.

 

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles