Files
nicole 289769a601
Automatic Documentation Deployment / Sync Docs to https://kb.bunny-lab.io (push) Successful in 8s
Restructured Documentation
2026-09-05 14:08:43 -06:00

20 lines
707 B
Markdown

---
tags:
- PowerShell
- Reporting
- Scripting
---
## Purpose
This document records the procedure for inactive users. Follow the environment assumptions and commands below.
```powershell
InactiveDays = 30
$Days = (Get-Date).Adddays(-($InactiveDays))
Get-ADUser -Filter {LastLogonTimeStamp -lt $Days -and enabled -eq $true} -Properties LastLogonTimeStamp |
select-object Name,@{Name="Date"; Expression={[DateTime]::FromFileTime($_.lastLogonTimestamp).ToString('MM-dd-yyyy')}}
```
## Related Documentation
- [Related Identity and Certificates Documentation](<../../../../reference/Identity and Certificates/index.md>) — Find the connected deployments, procedures, and references for this subject.