PowerShell for Windows Admins:

PowerShell 3


January 16, 2014  1:58 PM

Win32_Process examples–terminate process



Posted by: Richard Siddaway
CIM, PowerShell 3, PowerShell v4, WMI

Terminating a running process is simply a case of calling the Terminate method: function remove-proc{ [CmdletBinding()] param ( [string]$computername = $env:COMPUTERNAME, [string]$processname ) Get-CimInstance -ClassName Win32_Process -ComputerName $computername -Filter "Name...

January 16, 2014  1:41 PM

Win32_Process examples–set priority



Posted by: Richard Siddaway
CIM, PowerShell 3, PowerShell v4, WMI

Changing the priority of a process can give a processing boost to an application – but its not always a safe option. You can modify the process like this: function set-procpriority { [CmdletBinding()] param ( [string]$computername =...


January 15, 2014  2:02 PM

Win32_Process examples: get process owner



Posted by: Richard Siddaway
CIM, PowerShell 3, PowerShell v4, WMI

Moving on with examples of using Win32_Process you can find the process owner: function get-procowner { [CmdletBinding()] param ( [string]$computername = $env:COMPUTERNAME ) Get-CimInstance -ClassName Win32_Process -ComputerName $computername | foreach { $owner = Invoke-CimMethod...


January 14, 2014  12:50 PM

Win32_Process examples–processor time and memory usage



Posted by: Richard Siddaway
CIM, PowerShell 3, PowerShell v4, WMI

I saw some example code for using Win32_Process and didn’t like it so decided to create my own versions.  In this case the objective is to display the processor time and memory usage: function get-proctimeandRAM { [CmdletBinding()] param ( [string]$computername =...


January 5, 2014  10:27 AM

CDXML: Cim jobs



Posted by: Richard Siddaway
CDXML, CIM, PowerShell 3, PowerShell v4

One of the freebies you get when using CDXML is that the cmdlets you create automatically get the –AsJob parameter. I was thinking about jobs in general and realised that I didn’t know how CIM jobs were run. To put this into context: PowerShell jobs run in another PowerShell process that...


December 23, 2013  5:55 PM

CDXML–NetworkAdapterConfiguration–Search on Index



Posted by: Richard Siddaway
CDXML, CIM, PowerShell 3, PowerShell v4

The Win32_NetworkAdapterConfiguration class has an Index and an InterfaceIndex property. Both are suitable search properties.   The take an unsigned integer as their value – leading to this addition to the CDXML file:   <Property PropertyName="Index"> <Type...


December 23, 2013  11:57 AM

CDXML–NetworkAdapterConfiguration–IP Enabled



Posted by: Richard Siddaway
CDXML, CIM, PowerShell 3, PowerShell v4

Last time we added a search parameter enabling this: Get-NetworkAdapterConfiguration -DHCPEnabled $true   I also want to be able to search based on if the adapter if IP Enabled using: Get-NetworkAdapterConfiguration -IPEnabled $true   This can be achieved by specifying...


December 16, 2013  2:20 PM

CDXML–adding search parameters



Posted by: Richard Siddaway
CDXML, CIM, PowerShell 3, PowerShell v4

Last time you saw how to create a cmdlet from the Win32_NetWorkAdapterConfiguration class: <?xml version='1.0' encoding='utf-8'?> <PowerShellMetadata xmlns='http://schemas.microsoft.com/cmdlets-over-objects/2009/11'> <Class...


December 15, 2013  9:18 AM

CDXML–network adapter configuration



Posted by: Richard Siddaway
CDXML, CIM, PowerShell 3, PowerShell v4

I’ve amended the new-cdxml function created earlier in the series: function new-cdxml { [CmdletBinding()] param ( [Parameter(Mandatory=$true)] [string]$class, [Parameter(Mandatory=$true)] [string]$noun, [string]$namespace = 'ROOT\cimv2', [string]$path =...


December 8, 2013  3:58 PM



Posted by: Richard Siddaway
PowerShell 3, PowerShell v4, Windows 8, Windows 8.1

On a Windows Server 2012 or 2012 R2 system you can install the ServerManager module and use the Get-WindowsFeature cmdlet to discover the installed features. They can be managed with Install-WindowsFeature and Uninstall-WindowsFeature . These cmdlets don’t exist on Windows 8/8.1 However the...


Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: