Guy recommends :
Free Solarwinds
VM Console

Solarwinds VM Console Free Download

Find out which of your VMs are a waste of space and which VMs need more resources.



PowerShell Memory - CIM_PhysicalMemory

Check A Computer's Memory with PowerShell's CIM_PhysicalMemory

Our mission to use PowerShell to interrogate a computer's physical memory, to see the properties of that RAM stick(s).  Goals include discovering the capacity, speed and data width.  We also have pure PowerShell goals, to research with Get-member and to control the display with format-table -auto.

Topics for PowerShell Memory

 ♣

Trusty Twosome (Get-Help and Get-Member)

When you discover a new PowerShell command, it benefits from being surveyed with what I call the 'Trusty Twosome'.  Research with Get-Help and Get-Member and reveal new scripting possibilities for Get-WmiObject CIM_PhysicalMemory. To see what I mean start with Get-Help.

Preparation with PowerShell's Get-Help

The master cmdlet is Get-WmiObject, and as we will see later, PowerShell's CIM_PhysicalMemory is a class of this object.

# Help with PowerShell WMI object:
Get-help Get-WmiObject

Note 1: If you prefer examples: help gci -full

Get-help unearths useful parameters such as -class and -computerName (-computer also works).

Simple Example:  Display CIM_PhysicalMemory

A simple script to display your computer's physical memory.

# A simple command to display CIM_PhysicalMemory
Get-wmiobject CIM_PhysicalMemory

Those with a VBScript, or SQL background may be more familiar with query and select statement.  This achieves the same result, but is only useful if you wished to modify "Select *".

# Display CIM_PhysicalMemory using -query and "Select"
Get-wmiobject -query "Select * from CIM_PhysicalMemory"

Guy Recommends:  Solarwinds' Free Bulk Import ToolFree Download of Solarwinds  Bulk Import Tool

Import users from a spreadsheet.  Just provide a list of the users with their fields in the top row, and save as .csv file.  Then launch this FREE utility and match your fields with AD's attributes, click to import the users.  Optionally, you can provide the name of the OU where the new accounts will be born.

There are also two bonus tools in this free download, and all 3 have been approved by Microsoft:

  1. Bulk-import new users into Active Directory.
  2. Seek and zap unwanted user accounts.
  3. Find inactive computers.

Download your FREE bulk import tool.

Research Properties with Get-Member

# Properties for PowerShell memory object:
Get-WmiObject CIM_PhysicalMemory |Get-Member

Note 2:  If you enjoy aliases: gwmi CIM_PhysicalMemory | gm

Note 3: If you are fond of filters: gwmi CIM_PhysicalMemory| gm -Membertype property

Get-Member (gm) reveals a whole host of properties that you don't normally see in the Device Manager.

Refined Example: Using Properties We Researched with Get-Member

Get-wmiobject -query "Select * from CIM_PhysicalMemory" |`
Format-Table name, Capacity, DataWidth, Speed -auto

If you like this page then please share it with your friends

 


See More Microsoft PowerShell WMI Examples:

Home   • PowerShell Get-WmiObject   • WMI Services   • Win32_ComputerSystem

WMI Class  • [WMI] Type  • Win32_printer   • Win32_product   • SystemRestore

WMI Disk   • DNS   • PowerShell -Filter   • Windows PowerShell   • Memory

Please email me if you have a script examples. Also please report any factual mistakes, grammatical errors or broken links, I will be happy to correct the fault.

Download my ebook:Getting Started with PowerShell
Getting Started with PowerShell - only $9.25

You get 36 topics organized into these 3 sections:
   1) Getting Started
   2) Real-life tasks
   3) Examples of Syntax.

In addition to the ebook, you get a PDF version of this  Introduction to PowerShell ebook  It runs to 120 pages of A4.

 *


Custom Search

Guy Recommends: WMI Monitor and It's Free!Solarwinds WMI Monitor

Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems.

Fortunately, Solarwinds have created the Free WMI Monitor so that you can actually see and understand these gems of performance information.  Take the guess work out of which WMI counters to use for applications like Microsoft Active Directory, SQL or Exchange Server.

Download your free copy of WMI Monitor

 

Home Copyright © 1999-2012 Computer Performance LTD All rights reserved

Please report a broken link, or an error.