search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Getting hardware information of AD computers via PowerShell
Posted in Windows Powershell, Windows Server | 1 Comment | 2,952 views | 18/06/2013 13:39

This is an example to show you how to get hardware information of AD clients via PowerShell.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$Servers = Get-ADComputer -Filter {Name -like "C*"}
Foreach ($Server in $Servers)
{
	$Hostname = $Server.Name
	$ServerInfo = (Get-WmiObject -Computername $Hostname Win32_ComputerSystem)
	$Manufacturer = $ServerInfo.Manufacturer
	$Model = $ServerInfo.Model
	Write-Host "Name: $Hostname"
	Write-Host "Manufacturer: $Manufacturer"
	Write-Host "Model: $Model"
	Write-Host " "
	$Content = "$Hostname;$Manufacturer;$Model"
	Add-Content -Value $Content -Path "C:\ServerInfo.txt"
}

I’ve used filter to get specific computers.


Comments (1)

Bhavesh Gandhi

December 28th, 2016
23:19:20

Great scripts working out really great! Thank you!!



Leave a Reply