PowerShell for Windows Admins


November 20, 2012  4:44 PM

Introduction to PowerShell workflows



Posted by: Richard Siddaway
PowerShell 3, User Group

The recording, slides and demo scripts from tonights session are available at

https://skydrive.live.com/#cid=43CFA46A74CF3E96&id=43CFA46A74CF3E96%2140260

November 19, 2012  3:56 PM

Workflow session reminder



Posted by: Richard Siddaway
PowerShell 3, User Group

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

http://msmvps.com/blogs/richardsiddaway/archive/2012/11/14/powershell-group-session.aspx


November 19, 2012  12:27 PM

Kindle Fire quirk



Posted by: Richard Siddaway
Hardware

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



Posted by: Richard Siddaway
PowerShell 3, User Group

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


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


Where:

*~*~*~*~*~*~*~*~*~*

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

Notes


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.
Troubleshooting
Unable to join the meeting? Follow these steps:

  1. Copy this address and paste it into your web browser:
    https://www.livemeeting.com/cc/usergroups/join
  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

Notice
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



Posted by: Richard Siddaway
User Group

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



Posted by: Richard Siddaway
PowerShell 3, User Group

Quick reminder of tomorrow’s session

http://msmvps.com/blogs/richardsiddaway/archive/2012/10/20/uk-powershell-group-november-2012.aspx


November 7, 2012  2:42 PM

New about files



Posted by: Richard Siddaway
PowerShell 3, WMI

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:

about_WMI

about_WQL

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



Posted by: Richard Siddaway
PowerShell, PowerShell 3, WMI

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
__SUPERCLASS     :
__DYNASTY        :
__RELPATH        : Win32_Service.Name="AdobeARMservice"
__PROPERTY_COUNT : 3
__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



Posted by: Richard Siddaway
PowerShell

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



Posted by: Richard Siddaway
PowerShell

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

http://poshoholic.com/2012/11/02/powershell-summit-community-sessions-list/


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: