PowerShell for Windows Admins

November 19, 2012  3:56 PM

Workflow session reminder

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

The re-scheduled UK PowerShell group session on workflows will happen tomorrow. Details from


November 19, 2012  12:27 PM

Kindle Fire quirk

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Quick report of an oddity that I discovered with the Kindle Fire.  If you copy an ebook in mobi format onto the Fire you can read it with no problem.  If you select remove from device when you have finished reading the book it disappears from the list on books on the device. The file isn’t deleted though – you need to do that manually.

I’ve been using the Fire for a few weeks now and its an excellent travelling machine.

November 14, 2012  2:54 PM

PowerShell Group Session

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

I seem to have fixed my audio problems so I’m re-scheduling the session

When: Tuesday, Nov 20, 2012 7:30 PM (GMT)



Workflows are one of the big things in PowerShell v3. This session provides an introduction and overview of this must know technology


Richard Siddaway has invited you to attend an online meeting using Live Meeting.
Join the meeting.
Audio Information
Computer Audio
To use computer audio, you need speakers and microphone, or a headset.
First Time Users:
To save time before the meeting, check your system to make sure it is ready to use Microsoft Office Live Meeting.
Unable to join the meeting? Follow these steps:

  1. Copy this address and paste it into your web browser:
  2. Copy and paste the required information:
    Meeting ID: 4KTZN9
    Entry Code: 3G~mgr.P9
    Location: https://www.livemeeting.com/cc/usergroups

If you still cannot enter the meeting, contact support

Microsoft Office Live Meeting can be used to record meetings. By participating in this meeting, you agree that your communications may be monitored or recorded at any time during the meeting.

November 13, 2012  2:04 PM

Apologies for meeting failure

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Apologies to all who tried to attend the Live Meeting tonight – I had audio problems that I couldn’t resolve.

I’ll reschedule the session when I’ve fixed the problem

November 12, 2012  2:37 PM

UK PowerShell Group–13 November

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Quick reminder of tomorrow’s session


November 7, 2012  2:42 PM

New about files

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

PowerShell v3 features updateable help.  The help files are not quite complete at the moment but a recent update to the help that is available brought a couple of very useful files:



The first gives a good overview of WMI and the its structure.  Good background reading.

The second gives a very good start for using WMI Query Language – WQL.  It doesn’t cover everything – for instance associations are mentioned but it does give enough to work sensibly with WMI filters.

Both files are recommended reading

November 7, 2012  1:02 PM

WMI –property parameter

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

One parameter that seems to get overlooked on Get-WmiObject is the –Property parameter. It is used to specify the properties you want returned.

This is what you would normally get by default:

PS> Get-WmiObject -Class Win32_Service  | select -f 1

ExitCode  : 0
Name      : AdobeARMservice
ProcessId : 1716
StartMode : Auto
State     : Running
Status    : OK

The full property list looks like this:

PS> Get-WmiObject -Class Win32_Service  | select -f 1 | fl *

PSComputerName          : RSLAPTOP01
Name                    : AdobeARMservice
Status                  : OK
ExitCode                : 0
DesktopInteract         : False
ErrorControl            : Ignore
PathName                : "C:\Program Files\Common Files\Adobe\ARM\1.0\armsvc.exe"
ServiceType             : Own Process
StartMode               : Auto
__GENUS                 : 2
__CLASS                 : Win32_Service
__SUPERCLASS            : Win32_BaseService
__DYNASTY               : CIM_ManagedSystemElement
__RELPATH               : Win32_Service.Name="AdobeARMservice"
__PROPERTY_COUNT        : 25
__DERIVATION            : {Win32_BaseService, CIM_Service, CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER                : RSLAPTOP01
__NAMESPACE             : root\cimv2
__PATH                  : \\RSLAPTOP01\root\cimv2:Win32_Service.Name="AdobeARMservice"
AcceptPause             : False
AcceptStop              : True
Caption                 : Adobe Acrobat Update Service
CheckPoint              : 0
CreationClassName       : Win32_Service
Description             : Adobe Acrobat Updater keeps your Adobe software up to date.
DisplayName             : Adobe Acrobat Update Service
InstallDate             :
ProcessId               : 1716
ServiceSpecificExitCode : 0
Started                 : True
StartName               : LocalSystem
State                   : Running
SystemCreationClassName : Win32_ComputerSystem
SystemName              : RSLAPTOP01
TagId                   : 0
WaitHint                : 0
Scope                   : System.Management.ManagementScope
Path                    : \\RSLAPTOP01\root\cimv2:Win32_Service.Name="AdobeARMservice"
Options                 : System.Management.ObjectGetOptions
ClassPath               : \\RSLAPTOP01\root\cimv2:Win32_Service
Properties              : {AcceptPause, AcceptStop, Caption, CheckPoint…}
SystemProperties        : {__GENUS, __CLASS, __SUPERCLASS, __DYNASTY…}
Qualifiers              : {dynamic, Locale, provider, UUID}
Site                    :
Container               :

You can restrict the properties returned:

PS> Get-WmiObject -Class Win32_Service  -Property SystemName, Name, DisplayName | select -f 1

__GENUS          : 2
__CLASS          : Win32_Service
__DYNASTY        :
__RELPATH        : Win32_Service.Name="AdobeARMservice"
__DERIVATION     : {}
__SERVER         :
__NAMESPACE      :
__PATH           :
DisplayName      : Adobe Acrobat Update Service
Name             : AdobeARMservice
SystemName       : RSLAPTOP01
PSComputerName   :

problem is you still get the system properties (those that start __ )

PS> Get-WmiObject -Class Win32_Service  -Property SystemName, Name, DisplayName | select -f 1 | fl SystemName, Name, DisplayName

SystemName  : RSLAPTOP01
Name        : AdobeARMservice
DisplayName : Adobe Acrobat Update Service

replace the format-list (fl) by another select if you want to do anything with the object.

The new CIM cmdlets in PowerShell v3 also have a property parameter

PS> Get-CimInstance -Class Win32_Service  -Property SystemName, Name, DisplayName | select -f 1


Name                    : AdobeARMservice
Status                  :
ExitCode                :
DesktopInteract         :
ErrorControl            :
PathName                :
ServiceType             :
StartMode               :
Caption                 :
Description             :
InstallDate             :
CreationClassName       :
Started                 :
SystemCreationClassName :
SystemName              : RSLAPTOP01
AcceptPause             :
AcceptStop              :
DisplayName             : Adobe Acrobat Update Service
ServiceSpecificExitCode :
StartName               :
State                   :
TagId                   :
CheckPoint              :
ProcessId               :
WaitHint                :
PSComputerName          :
CimClass                : root/cimv2:Win32_Service
CimInstanceProperties   : {Caption, Description, InstallDate, Name…}
CimSystemProperties     : Microsoft.Management.Infrastructure.CimSystemProperties

This only populates the select properties but displays all properties by default!

use select again to restrict

PS> Get-CimInstance -ClassName Win32_Service  -Property SystemName, Name, DisplayName | select -f 1 | fl SystemName, Name, DisplayName

SystemName  : RSLAPTOP01
Name        : AdobeARMservice
DisplayName : Adobe Acrobat Update Service

Either way – WMI or CIM – you have to do a bit more work but the important point is that only the properties you want are returned across the network. Reduces traffic and should boost performance.

Using a WQL query returns the results shown above. This is because the –Filter parameter is turned into a WQL query.

November 4, 2012  4:04 AM

Honorary Scripting Guy

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

The Scripting Guy announced today that I have been awarded Honorary Scripting Guy status – http://blogs.technet.com/b/heyscriptingguy/archive/2012/11/04/announcing-the-2012-honorary-scripting-guys.aspx

This is a great honour for which I’m very grateful – thank you

Congratulations to the other awardees.

November 3, 2012  8:58 AM

PowerShell summit sessions announced

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

The sessions for the PowerShell summit at the Microsoft campus in April 2013 have been announced.


October 23, 2012  11:50 AM

DnsClient module: #2 DnsClient & Cache

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

The DnsClient module has a number of Get- cmdlets

Get-DnsClient | Format-List InterfaceAlias, ConnectionSpecificSuffix, Register*, UseSuffix*

An example of the output is

InterfaceAlias                 : Ethernet
ConnectionSpecificSuffix       :
RegisterThisConnectionsAddress : True
UseSuffixWhenRegistering       : False

Of more interest when trouble shooting is Get-DnsClientCache

PS> Get-DnsClientCache | select -f 1 | fl

Entry      :
RecordName :
RecordType : PTR
Status     : Success
Section    : Answer
TimeToLive : 86400
DataLength : 4
Data       : Win7test

You get a number of ways to interrogate the cache

PS> Get-Command Get-DnsClientCache  -Syntax

Get-DnsClientCache [[-Entry] <string[]>] [-Name <string[]>] [-Type <Type[]>] [-Status <Status[]>]
[-Section<Section[]>] [-TimeToLive <uint32[]>] [-DataLength <uint16[]>] [-Data <string[]>]
[-CimSession <CimSession[]>][-ThrottleLimit <int>] [-AsJob] [<CommonParameters>]

Its another CIM based cmdlet so you can use CimSessions to access remote machines. Very useful if you think the machine isn’t resolving DNS names properly

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: