Add Scripts/Powershell/Reporting/Inactive Computers.md
This commit is contained in:
5
Scripts/Powershell/Reporting/Inactive Computers.md
Normal file
5
Scripts/Powershell/Reporting/Inactive Computers.md
Normal file
@ -0,0 +1,5 @@
|
||||
``` powershell
|
||||
$DaysInactive = 30
|
||||
$time = (Get-Date).Adddays(-($DaysInactive))
|
||||
Get-ADComputer -Filter {LastLogonTimeStamp -lt $time} -ResultPageSize 2000 -resultSetSize $null -Properties Name | Select Name
|
||||
```
|
Reference in New Issue
Block a user