Do you know how can we do this? Either we question the AD to get the details by composing value in C# or personally examine the AD for the non-active records. But, there is another easy way which will get this details without any big initiatives. Yes, using Powershell program
- $COMPAREDATE=GET-DATE
- $NumberDays=90
- $CSVFileLocation='C:\TEMP\OldComps.CSV'
- GET-QADCOMPUTER -SizeLimit 0 -IncludedProperties LastLogonTimeStamp | where { ($CompareDate-$_.LastLogonTimeStamp).Days -gt $NumberDays } | Select-Object Name, LastLogonTimeStamp, OSName, ParentContainerDN | Sort-Object ModificationDate, Name | Export-CSV $CSVFileLocation
You have to provide the days - the timeline of inactive accounts and where to save the output of inactive accounts list.
The complete information is available at this post.http://gallery.technet.microsoft.com/scriptcenter/6b8163d1-5fae-43b5-a664-a2d1f6e1e2da
No comments:
Post a Comment