This project is a PowerShell script to collect hardware information from a Windows computer and automatically synchronize it with the Snipe-IT inventory system using its REST API.
- Collects:
- Computer name
- Serial number
- Model and manufacturer
- Operating system
- Processor (CPU)
- RAM
- Primary disk
- MAC address
- All IPv4 IP addresses
- Searches for the asset by serial number in Snipe-IT and:
- If it exists: updates the asset data (without changing the serial number)
- If it doesn't exist: creates a new asset
- Records all relevant information in the asset's notes field.
- Handles errors and displays detailed API responses.
- Windows 10/11 or Server with PowerShell 5.x or higher
- Network access to the Snipe-IT server and a valid API Token
- Permissions to run PowerShell scripts
-
Download the script Download the
snipe-it script.ps1file from this repository. -
Edit the script: Open
snipe-it script.ps1in your favorite editor and replace the line:
$ApiToken = "<YOUR_TOKEN_HERE>"with your actual Snipe-IT API Token.
- (Optional) Adjust the IDs:
If desired, adjust the
model_idandstatus_idvalues to match your Snipe-IT installation.
- Run PowerShell as administrator
- Navigate to the folder where you saved
snipe-it script.ps1 - Run:
.\ssnipe-it script.ps1- Follow the on-screen instructions.
- The script first searches for the asset by its serial number; if found, it updates only the configured fields (never the serial number); if not, it creates it.
- All IPv4 addresses assigned to the device are added to the
notesfield, along with the rest of the hardware information. - The script handles IP collection automatically for PowerShell 5.x and 7+.
- The
notesfield can be customized to add/remove information according to your needs.
MIT
Developed by Zeuss97 with help from GitHub Copilot.