Monthly Archives: January 2016

Scripting Game puzzle – – January 2016

Here’s how I’d solve the puzzle function get-starttime {    [CmdletBinding()]    param(        [parameter(                ValueFromPipeline=$true,                 ValueFromPipelineByPropertyName=$true)]        [Alias(‘CN’, ‘Computer’)]        [ValidateNotNullOrEmpty()]          [string[]]$computername = $env:COMPUTERNAME    )        PROCESS {            foreach ($computer in $computername){            $props = [ordered]@{                ComputerName = $computer                StartTime = ”                … Continue reading

Posted in PowerShell and CIM, Powershell Basics, Scripting Games | Leave a comment

PowerShell Deal of the Day – – 31 January 2016

PowerShell in Action, Third Edition is Manning’s Deal of the Day Sunday 31 January 2016 Deal of the Day January 31: Half off Windows PowerShell in Action, Third Edition. Use code dotd013116au at PowerShell in Depth, Second Edition is … Continue reading

Posted in Books, Powershell | 1 Comment

PowerShell editing options

I’ve used the ISE since it first appeared in PowerShell 2.0 but there are a couple of recent annocements that increase your code editing options ISE previews will become available out of band rather than being tied to WMF/OS releases … Continue reading

Posted in Powershell | Leave a comment

Which filter

Get-ADUser has 2 filter parameters. The –Filter takes a PowerShell syntax filter e.g. Get-ADUser -Filter {Name -eq ‘Richard’} The –LDAPfilter takes an LDAP search filter e.g. Get-ADUser -LDAPFilter “(Name=Richard)” Mixing them up will ensure you don’t get the results you … Continue reading

Posted in PowerShell and Active Directory | Leave a comment

Rescuing IE favourites

I received the new Windows Insider Windows 10 build over the wekend and have just discovered that installing it wiped out my IE favourites – or at least those in folders. I’d copied my favourites to Microsoft Edge when installing … Continue reading

Posted in Powershell | Leave a comment


How do you find the FQDN of the machine you’re using.  The simplest way is to combine a couple of environmental variables: PS> “$env:COMPUTERNAME.$env:USERDNSDOMAIN”SERVER02.MANTICORE.ORG If you like using CIM (and who doesn’t) you can try this PS> Get-CimInstance -ClassName Win32_ComputerSystem … Continue reading

Posted in Powershell Basics | 1 Comment

CDXML filter parameters

I was recently asked about adding a filter parameter to a cmdlet created through CDXML. If you’ve not seen it before (see PowerShell and WMI Chapters 18 & 19 from CDXML allows you to creat ecmdlets by wrapping a … Continue reading

Posted in CIM, Networking, PowerShell and CIM, PowerShell and WMI | Leave a comment

WMF 4.0 Updates available downlevel

The WMF 4.0 Updates that were released in November 2014 for Windows 8.1 and Windows Server 2012 R2 are now available for: Windows Server 2012 Windows Server 2008 R2 SP1 Windows 7 SP1 You need WMF 4.0 installed to install … Continue reading

Posted in PowerShell v4 | Leave a comment

Setting external time source in AD

The PDC emaulator in the root domain of your AD forest should point to an external time source. For some odd reason the PDC emulator in my lab wasn’t doing that. Easily remedied: #### set external time source## set server … Continue reading

Posted in PowerShell and Active Directory | Leave a comment

WMF 5.0

If you follow the PowerShell Team blog – (and if you don’t you should) you’ll know that the WMF 5.0 RTM downloads were pulled just before Christmas. This was due to a bug that reset the module environment. A … Continue reading

Posted in PowerShell v5, WMFv5 | 1 Comment