04 March,2019 by Tom Collins
Question: The server team have added a bunch og memory to a server . How can I get the Total Physical Memory of a server using Powershell? The server is a remote server.
Answer; A common method to extract the total physical memory of server is using : Get-WMIObject and TotalPhysicalMemory
According to the documentation : "The Get-WmiObject cmdlet gets instances of Windows Management Instrumentation (WMI) classes or information about the available WMI classes. "
There is an option to query a remote compueter by specifying a name on the -Computername switch.
An example of the Powershell code. The result will be in bytes. So you'll need to manipulate to get in GB or MB:
Get-WMIObject -Computername myservername -class win32_ComputerSystem | Select-Object -Expand TotalPhysicalMemory
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |