From 0a1a50ce94bc0d0d33cabd69f0e5f002973a33c5 Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Thu, 11 Jan 2024 20:19:16 -0700 Subject: [PATCH] Add Scripts/Powershell/Reporting/Inactive Computers.md --- Scripts/Powershell/Reporting/Inactive Computers.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Scripts/Powershell/Reporting/Inactive Computers.md diff --git a/Scripts/Powershell/Reporting/Inactive Computers.md b/Scripts/Powershell/Reporting/Inactive Computers.md new file mode 100644 index 0000000..97495af --- /dev/null +++ b/Scripts/Powershell/Reporting/Inactive Computers.md @@ -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 +``` \ No newline at end of file