cooper Posted November 18, 2016 Posted November 18, 2016 I have run the following to show me who has not logged in for the last 90 days Search-ADAccount -AccountInactive -TimeSpan 90.00:00:00 | where {$_.ObjectClass -eq 'user'} | FT Name,ObjectClass –A How can I add a group filter to this so I can show what staff, pupils have not logged in. Thanks Cooper
cooper Posted November 23, 2016 Author Posted November 23, 2016 Worked it out, see below Search-ADAccount -AccountInactive -SearchBase "OU=ENTER YOUR OU,DC=ENTER YOUR SCHOOL DC" -TimeSpan 90.00:00:00 | where {$_.ObjectClass -eq 'user'} | FT Name,ObjectClass –A | Out-File c:\InactiveUsers.txt
Davit2005 Posted November 23, 2016 Posted November 23, 2016 Have you more than one DC, have you run on both and compared results?? Jus wondering because I have seen different results because users authenticate against one DC or another.
Davit2005 Posted November 23, 2016 Posted November 23, 2016 Have you more than one DC, have you run on both and compared results?? Jus wondering because I have seen different results because users authenticate against one DC or another, would be useful to know.
cooper Posted November 23, 2016 Author Posted November 23, 2016 I have 2 DC and had the same results on both. Thanks for letting me know as I am going to test this at another school on Friday and will make sure I run on both.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now