Ae banner

Get List of Inactive Computers

run on AD to get inactive PCs

Description

RUN THIS ONLY ON ACTIVE DIRECTORY MACHINES
This procedure will get a list of inactive machines on the active directory.

Developer
  • Name: Kaseya Automation Team
  • Company: Kaseya
  • Website: http://www.kaseya.com
  • Contact Developer
  • Summary
  • Get List of Inactive Computers
  • 41 Downloads
  • Version:
  • Initially Released December 15th, 2020
  • Reviews

    Get List of Inactive Computers has no reviews.

    Discussion
    Gravatar for Larry Robertson
    Larry Robertson 4 months ago

    This procedure seems to want to pull and write a file called Gather-InactiveComputers.ps1.  However, it does not appear to be part of the download.  Where can we get this file? 

    Gravatar for Dhaval Brahmbhatt
    Dhaval Brahmbhatt 3 months ago

    Hey Larry, 

    I also saw that so I made the script myself. 

    Here is what you need in the script since I can't upload a file here. 

    ============================   

    $DaysInactive = 90

    $time = (Get-Date).Adddays(-($DaysInactive))

    (Get-ADComputer -Filter {LastLogonTimeStamp -lt $time} -ResultPageSize 2000 -resultSetSize $null -Properties Name, OperatingSystem, SamAccountName, DistinguishedName).Name

    ===========================

    Save it as Gather-InactiveComputers.ps1 in the appropriate location on your VSA, link it to the AP and Bob's your uncle! 


    Gravatar for Dhaval Brahmbhatt
    Dhaval Brahmbhatt 3 months ago

    Oh, since its powershell commands, you can tinker around with it as you want. Include date and time stamps and what not. I just needed a flat list of computer names. You could also append further powershell commands and then disable those computers in AD so that if in future, some employee finds an old laptop and wants to use it, all you do is enable the computer again. If no one complains after like 6 months of you disabling the computers found by this script, go ahead and delete those objects to keep your AD clean.