Récupération des information machine sous Windows
# **Gestion des information machine via cmd
**
# Info machine
```cmd
systeminfo | findstr /B /C:"Nom de l'hôte" /C:"OS Name" /C:"OS Version" /C:"Architecture"
```
# Info processeur
```cmd
wmic cpu get Name, NumberOfCores, NumberOfLogicalProcessors, MaxClockSpeed
```
# Info mémoire (équivalent lsmem)
```cmd
wmic memorychip get Capacity, Manufacturer, PartNumber, Speed
```
# Info processus en cours (équivalent lsof et ps)
```cmd
wmic process get ProcessId, Name, ExecutablePath
```
```cmd
tasklist
```
# Surveillance machine
```cmd
tasklist /v
```
---
---
# **Gestion des informations machine via PowerShell
**
# Info machine
```powershell
Get-ComputerInfo | Select-Object CsName, WindowsVersion, OsArchitecture
```
# Info processeur
```powershell
Get-CimInstance -ClassName Win32_Processor | Select-Object Name, NumberOfCores, NumberOfLogicalProcessors, MaxClockSpeed
```
# Info mémoire
```powershell
Get-CimInstance -ClassName Win32_PhysicalMemory | Select-Object Capacity, Manufacturer, PartNumber, Speed
```
# Info processus en cours
```powershell
Get-Process | Select-Object Id, ProcessName, Path
```
# Surveillance machine
```powershell
Get-Process | Sort-Object CPU -Descending | Select-Object -First 10 Id, ProcessName, CPU
```