# Script to find OS Edition and Physical RAM # Created by - Vinoth N Manoharan # Version 1.0 # Date - 22/07/2013 # Script Help :- #--------------- # Parameter 1 :- UNC File Path with Server list # Example1:- ServerOS.ps1 "Server List File Path" Clear-Host $List =@() $List1 =@() $final = @() $filename = $args[0] $computers = get-content $filename foreach ($computer in $computers) { if($computer -ne $null) { $srt = "Server Name :- " + $computer #$srt #Echo "---------------------------" $List = Get-WmiObject Win32_OperatingSystem -ComputerName $computer| SELECT CSName,Caption $List1 = Get-WMIObject Win32_PhysicalMemory -ComputerName $computer| Measure-Object -Property capacity -Sum |select @{N="Total_Physical_Ram"; E={[math]::round(($_.Sum / 1GB),2)}} $objvalue = $List1.Total_Physical_Ram $List|Add-Member -Name Total_Physical_Ram -MemberType NoteProperty -Value $objvalue $final += $List } } $final|ft -AutoSize
↧