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.

Computer Inventory script (Powershell)

*** THIS SCRIPT IS PROVIDED WITHOUT WARRANTY, USE AT YOUR OWN RISK ***

This inventory script will collect the following data for each machine in livePCs.txt file.

Computer Name
Manufacturer
Model
CPU Type
System Type
Build Version
OS
Service Pack Version
Serial Number
IP Address
MAC Address
User Name that last logged in
Date/Time of last login
C: Free Space in GBs
Total Physical Memory
Date/Time of last Reboot

Usage:

Export a list of computers you want to Inventory from Active Directory, that’s the computers.txt file in the script. The script will test the connection to each machine and export the results to 1 of 2 txt files, livePCs.txt or deadPCs.txt. Once that is complete the inventory will begin using the livePCs.txt file, all the results will be exported to C:\scripts\pcInventory.csv.

Obviously if you don’t have a scripts folder on the C: it will error out.

 

 

Leave a Reply

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