Remote Computer Inventory with PowerShell

This script uses WMI CMDlets for the most part, to gather some client hardware and software information remotely over the network. Click the link below to see the contents of the CSV file. I use it to collect the following information:

  • Computer Name
  • Manufacturer
  • Model
  • Processor Type
  • System Type
  • Operating system
  • Operating system Version
  • Operating system Build Version
  • Serial Number
  • IP Address MAC Address
  • Last User logged in
  • Last User login time
  • C: free space in GBs
  • Total RAM in GBs
  • The date and time of the last reboot

Computer_inventory_spreadsh

The video below goes into a little more detail as far as the mechanics. In subsequent videos I plan to turn this into a function and possibly a workflow in order to make it a little more efficient.

 

UPDATE: Below are the new video and the code for the functionalized version of the script above.

 

4 Comments

  1. Fabrice NOURRY | | Reply

    works fine for me ! thank you !

    #add description from active directory for my need

    $Description = Get-ADComputer -Filter {name -Like $computer} -Properties Description | Select Description

    $OutputObj | Add-Member -MemberType NoteProperty -Name Description -Value $Description.Description

    #and OS real install date (not upgrade date)

    $InstallDate = $wmi = Get-Item \\$computer\C$\Windows\CSC

    $OutputObj | Add-Member -MemberType NoteProperty -Name Install_Date -Value $InstallDate.LastWriteTime

    #and office version

    $OfficeVersionName = Get-WmiObject win32_product -ComputerName $Computer | where{$_.Name -like “*Office*”} | select Name | Get-Unique

    $OfficeVersion = Get-WmiObject win32_product -ComputerName $Computer | where{$_.Name -like “*Office*”} | select Version | Get-Unique

    $OutputObj | Add-Member -MemberType NoteProperty -Name Office_Name -Value $OfficeVersionName.Name
    $OutputObj | Add-Member -MemberType NoteProperty -Name Office_Version -Value $OfficeVersion.Version

  2. Prashant Gajjar | | Reply

    Hi David,
    this is looking great, but not working for me!! i have tried in two separate PC,.. no Luck 🙁 it is not giving any results.

  3. SL Manning | | Reply

    Hey David – know this is an older post, but I had a question. I have been running this script successfully for a while now; but we just started replacing some hardware. The new hardware has been on the network for about a week and the script is still reporting the old hardware specs (make, model, os, etc); is there a way to fix this?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.