289769a601
Automatic Documentation Deployment / Sync Docs to https://kb.bunny-lab.io (push) Successful in 8s
19 lines
614 B
Markdown
19 lines
614 B
Markdown
---
|
|
tags:
|
|
- PowerShell
|
|
- Reporting
|
|
- Scripting
|
|
---
|
|
|
|
## Purpose
|
|
This document records the procedure for inactive computers. Follow the environment assumptions and commands below.
|
|
|
|
```powershell
|
|
$DaysInactive = 30
|
|
$time = (Get-Date).Adddays(-($DaysInactive))
|
|
Get-ADComputer -Filter {LastLogonTimeStamp -lt $time} -ResultPageSize 2000 -resultSetSize $null -Properties Name | Select Name
|
|
```
|
|
|
|
## Related Documentation
|
|
- [Related Identity and Certificates Documentation](<../../../../reference/Identity and Certificates/index.md>) — Find the connected deployments, procedures, and references for this subject.
|