Skip to Main Content
Microsoft Exchange 2010 PowerShell Cookbook
book

Microsoft Exchange 2010 PowerShell Cookbook

by Mike Pfeiffer
July 2011
Intermediate to advanced content levelIntermediate to advanced
480 pages
11h 54m
English
Packt Publishing
Content preview from Microsoft Exchange 2010 PowerShell Cookbook

Monitoring memory utilization

To retrieve memory information from local and remote computers using PowerShell, we can use WMI, or query performance counters. In this recipe, you'll learn a few techniques that can be used to monitor memory utilization using the Get-WmiObject cmdlet.

How to do it...

  1. To gather memory utilization with WMI, we need to query two separate classes:
    $OS = Get-WmiObject Win32_OperatingSystem
    $CS = Get-WmiObject Win32_ComputerSystem
  2. Next, we can access the free and total physical memory from each object:
    How to do it...
  3. To convert the values to gigabytes, we need to use the mb and gb multipliers:

Now we can easily see that the local system has ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft Exchange Server 2013 PowerShell Cookbook: Second Edition - Second Edition

Microsoft Exchange Server 2013 PowerShell Cookbook: Second Edition - Second Edition

Jonas Andersson, Mike Pfeiffer

Publisher Resources

ISBN: 9781849682466Other