{"id":22,"date":"2019-01-03T03:09:33","date_gmt":"2019-01-03T08:09:33","guid":{"rendered":"http:\/\/itblog.ldlnet.net\/?p=22"},"modified":"2019-01-03T03:09:33","modified_gmt":"2019-01-03T08:09:33","slug":"show-available-ram-on-a-server","status":"publish","type":"post","link":"https:\/\/itblog.ldlnet.net\/index.php\/2019\/01\/03\/show-available-ram-on-a-server\/","title":{"rendered":"Show available RAM on a server"},"content":{"rendered":"\n<p>Here is a PowerShell .ps1 file snippet that will output the available RAM on a server. <br>You can name it freemem.ps1 and place in your local PowerShell scripts directory.<br>Thanks to the following for the script: <a href=\"https:\/\/www.shogan.co.uk\/how-tos\/powershell-check-free-memory-script\/\">Click Here<\/a><\/p>\n\n\n<pre class=\"lang:PowerShell\" title=\"FreeMem.ps1 Script\">$freemem = Get-WmiObject -Class Win32_OperatingSystem\n\u00a0\n# Display free memory on PC\/Server\n\"---------FREE MEMORY CHECK----------\"\n\"\"\n\"System Name\u00a0\u00a0\u00a0\u00a0   : {0}\" -f $freemem.csname\n\"Total Memory (GB) : {0}\" -f ([math]::round(($freemem.TotalVisibleMemorySize \/ 1024 \/ 1024), 2))\n\"Free Memory (MB)  : {0}\" -f ([math]::round($freemem.FreePhysicalMemory \/ 1024, 2))\n\"Free Memory (GB)  : {0}\" -f ([math]::round(($freemem.FreePhysicalMemory \/ 1024 \/ 1024), 2))\n\"\"\n\"------------------------------------\"<\/pre>\n\n\n\n<p>If you need to find out what processes are using the most memory, you can run the following PowerShell cmdlet to do so:<\/p>\n\n\n<pre class=\"lang:PowerShell\" title=\"Processes Using Memory Cmdlet\">get-wmiobject WIN32_PROCESS | Sort-Object -Property ws -Descending|select -first 15 | Select processname, @{Name=\"MemUsage(MB)\";Expression={[math]::round($_.ws \/ 1mb)}},@{Name=\"ProcessID\";Expression={[String]$_.ProcessID}},@{Name=\"UserID\";Expression={$_.getowner().user}} | ft -a -wr<\/pre>\n\n\n\n<p>Happy Troubleshooting!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a PowerShell .ps1 file snippet that will output the available RAM on a server. You can name it freemem.ps1 and<\/p>\n<p class=\"link-more\"><a class=\"myButt \" href=\"https:\/\/itblog.ldlnet.net\/index.php\/2019\/01\/03\/show-available-ram-on-a-server\/\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,16],"tags":[15,17,8,13],"class_list":["post-22","post","type-post","status-publish","format-standard","hentry","category-powershell","category-windows","tag-cmdlet","tag-memory","tag-powershell","tag-script","odd"],"_links":{"self":[{"href":"https:\/\/itblog.ldlnet.net\/index.php\/wp-json\/wp\/v2\/posts\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itblog.ldlnet.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itblog.ldlnet.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itblog.ldlnet.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itblog.ldlnet.net\/index.php\/wp-json\/wp\/v2\/comments?post=22"}],"version-history":[{"count":1,"href":"https:\/\/itblog.ldlnet.net\/index.php\/wp-json\/wp\/v2\/posts\/22\/revisions"}],"predecessor-version":[{"id":23,"href":"https:\/\/itblog.ldlnet.net\/index.php\/wp-json\/wp\/v2\/posts\/22\/revisions\/23"}],"wp:attachment":[{"href":"https:\/\/itblog.ldlnet.net\/index.php\/wp-json\/wp\/v2\/media?parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itblog.ldlnet.net\/index.php\/wp-json\/wp\/v2\/categories?post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itblog.ldlnet.net\/index.php\/wp-json\/wp\/v2\/tags?post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}