Disclaimer
This is my personal blog. The opinions and views I express are my own. The information I provide is on an as-is basis. I make no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this blog and will not be liable for any errors, omissions, or delays in this information or any losses, injuries or damages arising from its use.

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.

 

7 Comments

  1. Richard | | Reply

    I figure out how by using Fabrice’s notes and the PS GET-HELP GET-ADComputer in PS.

    It resulted in this:

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

    $OutputObj | Add-Member -MemberType NoteProperty -Name OU -Value $OU.CanonicalName

    Works for my purpose!

  2. Richard | | Reply

    This works great for me. Much appreciated!

    Is there a way to add the ability to get what OU each system resides?

  3. 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

  4. 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.

  5. 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.