Skip to main content

Closed demo: sign-ups open

Sign up

IT asset inventory: the method, the template and the PowerShell script

What to record, how to do it fast and which tool to choose: the method to inventory an SME's IT fleet, a column template and a PowerShell script that fills it in.

Published 22 November 2026 · 5 min read

How many devices do you have, exactly? Which ones are still under warranty? Who is using the laptop with serial number 5CG1234XYZ? Without an up-to-date inventory, these simple questions take hours. With an inventory, they take ten seconds, and every decision that follows (budget, replacement, security) rests on facts.

The short answer

To inventory an IT fleet: set the columns to fill in, collect the data from each device (by hand, by script or by agent), centralise it in a single file or a single tool, then organise updates at every arrival, departure and purchase. Beyond a few dozen devices, only an automatic inventory stays accurate over time: with a tool like LongLife, it builds itself as soon as the agent is installed and stays up to date on its own.

What to record

ColumnExampleWhy
TypeLaptopPlan purchases by category
Manufacturer and modelDell Latitude 5420Parts, drivers, known issues with a model
Serial number5CG1234XYZWarranty, manufacturer support, theft
Device namePC-COMPTA-07Find it on the network
User and departmentMr Martin, accountsKnow who to notify
SiteNantesOrganise interventions
Processor, memory, disk11th gen Core i5, 16 GB, 512 GB SSDPossible upgrades, Windows 11 compatibility
Operating system and versionWindows 11 Pro 25H2Security, end of support
Purchase date and price03/2022, €950 excl. VATDepreciation, real age
End of warranty03/2025Repair under warranty while it runs
StatusIn serviceStop paying for retired equipment

Add monitors, docking stations and phones if you track them, but start with the computers: that is where budget and security are decided.

Three methods, depending on the size of the fleet

MethodUp toAdvantageLimit
Spreadsheet filled in by hand15 to 20 devicesNothing to installOut of date at the first change, typing errors
PowerShell script run on each deviceAbout 50 devicesAccurate data, freeMust be run again to update
Agent installed on each device (LongLife)No limitAlways up to date, no intervention, with the condition of each deviceAn agent to deploy, silently through GPO or Intune

The PowerShell inventory script

This script collects the essential information from a Windows device and adds it to a CSV file you open in Excel. Open PowerShell (right-click the Start menu, then "Terminal") and paste:

PowerShell
$cs   = Get-CimInstance Win32_ComputerSystem
$bios = Get-CimInstance Win32_BIOS
$cpu  = Get-CimInstance Win32_Processor | Select-Object -First 1
$os   = Get-CimInstance Win32_OperatingSystem
$disk = Get-PhysicalDisk | Select-Object -First 1

[pscustomobject]@{
  Poste        = $env:COMPUTERNAME
  Utilisateur  = $cs.UserName
  Fabricant    = $cs.Manufacturer
  Modele       = $cs.Model
  NumeroSerie  = $bios.SerialNumber
  Processeur   = $cpu.Name
  MemoireGo    = [math]::Round($cs.TotalPhysicalMemory / 1GB)
  Disque       = "$($disk.MediaType) $([math]::Round($disk.Size / 1GB)) Go"
  Systeme      = $os.Caption
  Build        = $os.BuildNumber
  Installation = $os.InstallDate
  Releve       = Get-Date -Format "yyyy-MM-dd"
} | Export-Csv -Path "\\SERVEUR\Inventaire\parc.csv" -Append -NoTypeInformation -Delimiter ";" -Encoding UTF8

What you need to know:

  • the column names are in French (Poste = device, Utilisateur = user, Fabricant = manufacturer, Modele = model, NumeroSerie = serial number, MemoireGo = memory in GB, Disque = disk, Systeme = operating system, Releve = collection date): rename them freely, they are only labels;
  • replace \\SERVEUR\Inventaire\parc.csv with a shared folder you can write to, or with "$env:USERPROFILE\Desktop\parc.csv" for a test;
  • -Append adds a line at each run: run on every device, the script fills in the same file;
  • -Delimiter ";" produces a file that opens cleanly in Excel set to French and many other European locales; with Excel in English, remove this parameter to get the default comma;
  • the purchase date, price and warranty are not on the device: add them from the invoices or the manufacturer's website, using the serial number.

To run the script on all the devices in a domain, put it in a logon script or a scheduled task deployed by Group Policy.

Keep the inventory up to date

An inventory is only worth something if it is accurate. Three rules are enough:

  1. One place: one file or one tool, not one spreadsheet per department.
  2. Triggers: every arrival, departure, purchase, repair or retirement of equipment updates the line concerned.
  3. A yearly check: compare the inventory with reality (devices seen on the network, devices in stock). The gaps reveal lost devices and licences paid for nothing.

The inventory is also the first step of preventive maintenance and of the replacement plan: you only decide well on a fleet you know. To go further on asset management, see our definition of ITAM, and that of the CMDB for mapping dependencies.

LongLife, the inventory that takes itself

You install the LongLife agent on each device: the inventory builds itself from installation and stays up to date, with no script to rerun and no spreadsheet to maintain. For each device you find:

  • its configuration: model, processor, memory, disks, battery, operating system and version;
  • its software: installed applications with their vendor and version, and the licences actually used, thanks to AppBox;
  • its peripherals: USB, Bluetooth, printers;
  • where it belongs: site, department or group, and its history in the health log.

It is a real CMDB of your fleet of devices, and LongLife goes further than an inventory: it tells you what condition each device is in. Hardware condition, stability, security posture and Windows end of support, then a recommendation per device (keep, upgrade or replace) with the cost and CO₂e of each option.

LongLife works on its own, or alongside GLPI if you use it for tickets. The free plan covers up to 15 devices. Try the simulator or book a meeting to see your fleet in LongLife.

Sources

Frequently asked questions

How do you take an inventory of an IT fleet?

First define the columns to fill in (model, serial number, user, operating system, purchase date, warranty), then collect the information: by hand in a spreadsheet for a few devices, with a PowerShell script for a few dozen, with an agent such as LongLife's beyond that, so the inventory stays up to date by itself.

Which software should you use for an IT asset inventory?

Software that takes the inventory by itself, with an agent on each device. LongLife keeps the inventory and CMDB of your devices up to date (hardware, software, peripherals, security), adds the health of each device and recommends keeping, upgrading or replacing it. Its free plan covers up to 15 devices, and it works on its own or alongside GLPI.

What should an IT inventory contain?

At a minimum, for each item of equipment, the type, manufacturer, model, serial number, user, site, operating system, purchase date, end of warranty and status (in service, in stock, under repair, retired).

How often should the inventory be updated?

Ideally, continuously. An inventory kept by hand goes out of date as soon as a device moves desk. Without an automatic tool, redo it at least once a year and update it at every arrival, departure or purchase.

How much longer can your fleet last?

The simulator estimates in one minute the budget and CO₂ saved by extending your renewal cycle.

Read next