Wednesday 29 July 2015

How to get Total installed memory on remote systems and export to csv


$computers= Get-Content -Path C:\servers.txt

$info=@()

foreach($computer in $computers){
$colItems = get-wmiobject -class "Win32_ComputerSystem" -namespace "root\CIMV2" -computername $computer

foreach ($objItem in $colItems){
$displayGB = [math]::round($objItem.TotalPhysicalMemory/1024/1024/1024, 0)
$res = "" | select Computer,Memory
$res.computer = $computer
$res.Memory = $displayGB

$info +=$res

}
}
$info | Export-Csv c:\12.csv -NoTypeInformation

Powershell function to get theremote server IP details,Subnetmask,Gateway,DHCP Enabled status,DNS Servers,Wins and Macaddress

#Powershell function to get theremote server IP details,Subnetmask,Gateway,DHCP Enabled status,DNS Servers,Wins and Macaddress # use...