Quantcast
Channel: Directory Services forum
Viewing all articles
Browse latest Browse all 31638

How inactive users become in active directory

$
0
0

Hey I have below script to pull out the information of inactive users in domain.

But I want to understand that on which attribute, inactive users mark as inactive in AD.

I mean the attribute of lastlogontimestamp or lastlogondate?

Hence, I have most of the users in my domain which lastlogontimestamp or lastlogondate is not set their attributes then How can I get to know the these accounts are inactive in AD?

Import-Module Activedirectory
Search-ADAccount -accountinactive -usersonly -DateTime (Get-Date).AddMonths(-14) | Where {$_.SamAccountName -like "d00*" -and $_.enabled}| select name,SamAccountName,lastlogondate,UserPrincipalName | Export-Csv C:\inactive.csv -NoTypeInformation


Viewing all articles
Browse latest Browse all 31638

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>