Do you know how can we do this? Either we query the AD to get the information by writing code in C# or manually check the AD for the inactive accounts. But, there is another simple way which will get this information without any big efforts. Yes, using Powershell script.
The complete information is available at this post.
$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 $CSVFileLocationYou 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.
This comment has been removed by the author.
ReplyDelete