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
SyFyAsked:
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.
0
 
Venugopal NCommented:
You can use the dsquery to get the list of stale users account.

http://technet.microsoft.com/en-us/library/cc725702.aspx
0
 
Venugopal NCommented:
dsquery user -o rdn/samid  -inactive 26 -limit 0
0
 
becraigCommented:
Replace 240 below with the number of days you want to check for

import-module ac*
Search-ADAccount -AccountInactive -TimeSpan ([timespan]240d) -UsersOnly
0
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.