Need a script of csvde command

Need a script or csvde command to export list of users that are enabled in domain but have not logged on the the domain in x number of days
Who is Participating?
becraigConnect With a Mentor Commented:
Try if this works:
import-module ac*
Get-ADUser -Filter 'enabled -eq $true' | Format-Table -Property name, LastLogonDate

Open in new window

If not I can probably tweak it a bit to get exactly what you need.
Venugopal NCommented:
You can use the dsquery to get the list of stale users account.
Venugopal NCommented:
dsquery user -o rdn/samid  -inactive 26 -limit 0
Replace 240 below with the number of days you want to check for

import-module ac*
Search-ADAccount -AccountInactive -TimeSpan ([timespan]240d) -UsersOnly
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.