Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources: Active Threads
Viewing all articles
Browse latest Browse all 8411

Get-WmiObject Win32_Computersystem | Format-List Name, manufacturer, model, SystemType, TotalPhysicalMemory, NumberOfLogicalProcessors

$
0
0

Need to extract info using wmi for all laptops on domain.

$strFilter = "computer"
  
$objDomain = New-Object System.DirectoryServices.DirectoryEntry
 $objSearcher = New-Object System.DirectoryServices.DirectorySearcher
 $objSearcher.SearchRoot = "LDAP://OU=xp,OU=laptops,OU=Devices,DC=prod,dc=prv"
 $objSearcher.PageSize = 1000
 
 $objSearcher.Filter = "(objectCategory=$strFilter)"
 $colResults = $objSearcher.FindAll()
 
 foreach ($i in $colResults)
{
     $objComputer = $i.GetDirectoryEntry()
     #Get-WmiObject Win32_ComputerSystemProduct | Select Vendor, Version, Name
     Get-WmiObject Win32_Computersystem | Format-List Name, manufacturer, model, SystemType, TotalPhysicalMemory, NumberOfLogicalProcessors
     }

This only pulls my wmi info


Viewing all articles
Browse latest Browse all 8411