Browse by Tags

All Tags » PowerShell V2 » PowerShell V3 (RSS)

Displaying data from multiple servers as HTML

A forum question regarding retrieving WMI based data from multiple servers and displaying it as HTML was interesting.  I would approach it like this $servers = Get-Content -Path C:\scripts\servers.txt $data = @( ) foreach ( $server in $servers )...

Ensuring that parameter values are passed to your function

A question on the forum about a function had me thinking. The user had defined two parameters for the function and then used Read-Host to get the values. NO Much better way is to use an advanced function and make the parameters mandatory function Getuserdetails...

WMI property names

A question brought it home to me that WMI property names don’t always mean what you might think they mean – this is also true of other objects but I tripped over this one with WMI so we’ll stick with that. PS> Get-CimInstance -ClassName Win32_Desktop...

Working with profiles: 2 deleting profiles

I recently (1 June) showed how to discover the user profiles on your system. Now its time to delete them. function remove-profile { param ( [ parameter ( Mandatory = $true ) ] [string] $username ) $user = Get-CimInstance -Class Win32_UserAccount -Filter...

Using a colon with cmdlet parameters

Another question at Tuesdays PowerShell group revolved around using colons to link values to parameters. I’d not really thought about before. Thinking about it  later I realised that you only really see it when passing booleans to –Confirm. ...

Working with WMI methods

Many WMI classes have methods. Methods allow us to perform some action on the object. A recent question on the forum about using methods made me realise that there are still a lot of people following the old VBScript way of doing things. We will experiment...

Using Invoke-WmiMethod to set the DNS servers

In the last post I showed that there was an issue with the way the SetDNSServerSearchOrder of the Win32_NetworkAdapterConfiguration class worked This would work $nic = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "Index=7"...

TCP/IP Alternative Configurations: pt III set the alternative configuration

  We have seen how to set the NIC to use DHCP to get its address. This post shows how to set the alternative configuration on the NIC. If you just  want APIPA then do nothing – other wise use this script $HKLM = 2147483650 #HKEY_LOCAL_MACHINE...

PowerShell and WMI

My latest book – PowerShell and WMI – has gone to the printers. Expect it soon at a book shop near you. www.manning.com/powershellandwmi for more details

PowerShell Deep Dive 2012 Agenda

The agenda for the PowerShell Deep Dive next month has just been published on the PowerShell team blog http://blogs.msdn.com/b/powershell/archive/2012/03/26/schedule-for-the-upcoming-powershell-deep-dive-and-a-few-videos-from-frankfurt.aspx If you are...

PowerShell books–March 2012

Back in January last year I posted about my preferred set of PowerShell books. http://msmvps.com/blogs/richardsiddaway/archive/2011/01/09/powershell-books.aspx Its time to update that list I’ll start by removing the first edition of books where the second...
Posted by RichardSiddaway | with no comments

Remoting between PowerShell v3 CTP 2 and PowerShell v2

One of the questions on tonight’s Live Meeting concerned the compatibility between remoting on PowerShell v2 and PowerShell v3 CTP 2 The difference is that v3 uses a WSMAN 3.0 stack but v2 uses 2.0 I used two machines: Windows 2008 R2 SP 1 with PowerShell...

UK PowerShell Group–December 2011

When: Thursday, Dec 15, 2011 7:30 PM (GMT) Where: Virtual *~*~*~*~*~*~*~*~*~* Discover how to use the WSMAN cmdlets to retreive WMI information and see a demo of the new WMI API's CIM cmdlets in PowerShell v3 CTP 2 Notes Richard Siddaway has invited...

select-object quirk

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...
Posted by RichardSiddaway | with no comments

PowerShell Deep Dive speakers

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...