Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using wmic /node:NODENAME memlogical get totalpagefilespace but it does not work on all windows versions. Is there a command which works on all windows version?

Note: Without having to install any 3rd party pgms

share|improve this question
1  
What versions is that not working against? –  Jim B Jan 19 '12 at 6:45
    
@Jim B: OS Name Microsoft® Windows Server® 2008 Enterprise. (64bit) It says memlogical - Alias not found. –  Abhishek Simon Jan 19 '12 at 9:14

1 Answer 1

PowerShell would do the trick:

gc c:\servers.txt | % {
    $server = $_
    $physicalmem = gwmi -computer $server Win32_ComputerSystem | % {$_.TotalPhysicalMemory}
    gwmi -computer $server Win32_PageFile | select `
        @{ Name = "Server" ; Expression = { $server.ToUpper() } },
        @{ Name = "PageFileLocation" ; Expression = { $_.Name } },
        @{ Name = "PageFileSize" ; Expression = { [Math]::Round($_.FileSize/1MB,0) } },
        @{ Name = "PhysicalMemory" ; Expression = { [Math]::round($physicalmem/1MB,0) } }
}
share|improve this answer
    
Thanks, but i already mentioned, I need something without using any 3rd party pgms as this is going to be used by customers n without dependency of installing any 3rd party applications –  Abhishek Simon Jan 23 '12 at 4:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.