header image

Archive for September, 2011

WMI provider and MOF file

Posted by: | September 27, 2011 | No Comment |

WMI is installed as a series of providers. The information on creating the classes comes from MOF files. I was recently asked about a problem with a specific class & could it be restored – in this case it was easier to rebuild WMI as the provider created a large part of the root\cimv2 namespace […]

under: PowerShell and WMI

There are many people who don’t like to see the WMI system properties PS> Get-WmiObject -Class Win32_OperatingSystem | select __* __GENUS          : 2 __CLASS          : Win32_OperatingSystem __SUPERCLASS     : CIM_OperatingSystem __DYNASTY        : CIM_ManagedSystemElement __RELPATH        : Win32_OperatingSystem=@ __PROPERTY_COUNT : 63 __DERIVATION     : {CIM_OperatingSystem, CIM_LogicalElement, CIM_ManagedSystemElement} __SERVER         : RSLAPTOP01 __NAMESPACE      : root\cimv2 __PATH           : \\RSLAPTOP01\root\cimv2:Win32_OperatingSystem=@ Now one day […]

under: PowerShell and WMI

In this post http://msmvps.com/blogs/richardsiddaway/archive/2011/09/20/powershell-and-dhcp-1-servers.aspx I showed how we could discover DHCP server information Scopes can be discovered Get-DhcpServerv4Scope -ComputerName server02  -ScopeId Now how do we create a scope? We use Add-DhcpServerv4Scope. Now shouldn’t that have been New-DhcpServerv4Scope? Never the less this is how it works Add-DhcpServerv4Scope -ComputerName server02 -Name TestScope  -StartRange -EndRange […]

under: DHCP, PowerShell V3, Windows 8 Server

The recording of Aleksandar’s session for the UK user group http://msmvps.com/blogs/richardsiddaway/archive/2011/09/08/powershell-user-group-20-september-2011.aspx entitled PowerShell remoting and the customisation of remoting end points Is available from https://skydrive.live.com/?cid=43cfa46a74cf3e96#!/?cid=43cfa46a74cf3e96&sc=documents&uc=1&id=43CFA46A74CF3E96%212927   The slides and demo scripts are included in the zip file. The next meeting will be 25 Oct  2011 on WSMAN and WMI.  It is an extended version of […]

under: PowerShell User Group

select-object quirk

Posted by: | September 21, 2011 | 2 Comments |

I was working with the new CIM cmdlets in PowerShell 3 CTP and mistyped a command (as I thought) Get-Cimclass win32_operatingsystem | select -ExpandProperty methods | select -f 1 select -ExpandProperty Qualifiers   My surprise was because of the two uses of select without a pipe between them.  It works, I don’t know why – […]

under: PowerShell V3, PowerShellV2

PowerShell Deep Dive speakers

Posted by: | September 21, 2011 | No Comment |

Some more sessions have been announced for the Deep Dive http://www.theexpertsconference.com/europe/2011/powershell-deep-dive/session-abstracts/ The speaker line up includes: Aleksandar Nikolic Shay Levy Kirk Munro Dmitry Sotnikov Jeffery Hicks James Brundage Tobias Weltner Brandon Shell James O’Neill Ravi Chaganti Me   There will also be a significant presence from the PowerShell team.   If you can’t get your […]

under: Deep Dive, PowerShell Basics, PowerShell V3, PowerShellV2

Remember that yesterday I loaded the RSAT tools on to my Windows 8 server instance. This includes a PowerShell module that auto loads – like all Windows 8 modules on the PS module path Start by looking at the GET commands Get-Command -Module DhcpServer   get* Get-DhcpServerAuditLog Get-DhcpServerDatabase Get-DhcpServerInDC Get-DhcpServerSetting Get-DhcpServerv4Binding Get-DhcpServerv4Class Get-DhcpServerv4DnsSetting Get-DhcpServerv4ExclusionRange Get-DhcpServerv4Failover Get-DhcpServerv4Filter […]

under: PowerShell V3, Windows 8 Server

PowerShell 3 CTP1

Posted by: | September 20, 2011 | No Comment |

Today’s big news is the release of CTP1 for PowerShell 3 http://www.microsoft.com/download/en/details.aspx?id=27548 It only runs on Windows 7 SP1 and Windows 2008 R2 SP1

under: PowerShell V3

I added the RSAT tools using the server manager module PS> Get-Command -Module servermanager CommandType     Name ———–     —- Alias           Add-WindowsFeature Alias           Remove-WindowsFeature Cmdlet          Get-WindowsFeature Cmdlet          Install-WindowsFeature Cmdlet          Uninstall-WindowsFeature Notice the name changes Add/Remove are now aliases with the cmdlets as install/uninstall Use Install-WindowsFeature -Name RSAT -IncludeAllSubFeature –Restart to force the restart. PowerShell needs to be […]

under: PowerShell V3, Windows 8 Server

Split-Path & UNC

Posted by: | September 19, 2011 | No Comment |

split-path works with with UNC paths as well as normal paths   PS> $path = "\\UNCserver\TFSBuilds\componenet\v11.1\XS11.1\XS11.1_11.1.0.35" PS> Split-Path -Path $path -Parent \\UNCserver\TFSBuilds\componenet\v11.1\XS11.1   PS> Split-Path -Path (get-location) -Parent C:\scripts

under: File System

Older Posts »