Remote Windows Computer Inventory

Remote Windows Computer Inventory

Here’s a PowerShell script that gathers detailed inventory information from a remote computer. This script retrieves information about the operating s

Changing PWDLASTSET in Active Directory
Windows Defender Real Time Monitoring Status
Disable/Enable all Network Adapters

Here’s a PowerShell script that gathers detailed inventory information from a remote computer. This script retrieves information about the operating system, CPU, disk, network, installed software, and hardware devices. Please replace "RemoteComputerName" with the actual name of the remote computer.

This script retrieves and outputs the following information:

  • Computer name
  • Operating system and service pack version
  • CPU details
  • Disk capacity and free space for the C: drive
  • Network information including IP address, MAC address, and DNS servers
  • List of installed software
  • List of hardware devices

Please note that retrieving a list of installed software using Win32_Product class can be slow and it may trigger a consistency check of the installed software. This can potentially lead to a longer execution time and high CPU usage. Always test scripts in a controlled environment before using them in production.

$computerName = "RemoteComputerName"

# Create a WMI Object for the specified computer
$computerSystem = Get-WmiObject -Class Win32_ComputerSystem -ComputerName $computerName
$os = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $computerName
$cpu = Get-WmiObject -Class Win32_Processor -ComputerName $computerName
$disk = Get-WmiObject -Class Win32_LogicalDisk -ComputerName $computerName -Filter "DeviceID='C:'"
$network = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -ComputerName $computerName | Where-Object { $_.IPAddress -ne $null }
$software = Get-WmiObject -Class Win32_Product -ComputerName $computerName
$devices = Get-WmiObject -Class Win32_PnPEntity -ComputerName $computerName

# Output information
Write-Output "Computer Name: $($computerSystem.Name)"
Write-Output "Operating System: $($os.Caption), Service Pack: $($os.ServicePackMajorVersion).$($os.ServicePackMinorVersion)"
Write-Output "CPU: $($cpu.Name)"
Write-Output "Disk C: Capacity: $($disk.Size / 1GB -as [int])GB, Free Space: $($disk.FreeSpace / 1GB -as [int])GB"
Write-Output "Network Information: "
$network | ForEach-Object {
    Write-Output "`tIP Address: $($_.IPAddress[0])"
    Write-Output "`tMAC Address: $($_.MACAddress)"
    Write-Output "`tDNS Servers: $($_.DNSServerSearchOrder -join ', ')"
}
Write-Output "Installed Software: "
$software | ForEach-Object {
    Write-Output "`t$($_.Name)"
}
Write-Output "Hardware Devices: "
$devices | ForEach-Object {
    Write-Output "`t$($_.Caption)"
}

 

COMMENTS

WORDPRESS: 0