header image

Archive for October, 2015

WMI linked classes

Posted by: | October 17, 2015 Comments Off on WMI linked classes |

You will find that many WMI classes have links – some are associations built in to WMI (a subject for another time) while other classes can be linked based on property values. An example of the latter is the Win32_NetworkAdapter and Win32_NetworkAdapterConfiguration classes. The DeviceId on Win32_NetworkAdapter  matches Index on Win32_NetworkAdapterConfiguration .   The follwoing […]

under: CIM, PowerShell and WMI

Manning Deal of The Day – 17 October 2015

Posted by: | October 16, 2015 Comments Off on Manning Deal of The Day – 17 October 2015 |

A treat for PowerShell users looking for books. 50% off PowerShell in Depth, second edition and PowerShell in Action, third edition on 17 October 2015   Half off Windows PowerShell in Action, Third Edition. Use code dotd101715au at https://www.manning.com/books/windows-powershell-in-action- third-edition   Half off Powershell in Depth, Second Edition. Use code dotd101715au at https://www.manning.com/books/powershell-in-depth-second-edition   I’m […]

under: Books, PowerShell

Modifying MAC address

Posted by: | October 14, 2015 Comments Off on Modifying MAC address |

  Another question on the forum brought up an interesting point. User want adapter name and mac address PS> Get-NetAdapter | select Name, MacAddress Name                         MacAddress —-                         ———- WiFi                         28-18-78-D0-05-11 Bluetooth Network Connection 28-18-78-D0-05-12   but wanted to remove the hyphens in the mac address so tried PS> Get-NetAdapter | select Name, MacAddress | foreach […]

under: Networking, PowerShell Basics

NICs with IP addresses

Posted by: | October 14, 2015 Comments Off on NICs with IP addresses |

A question on the forum asked about discovering those network adapters that had IP addresses configured. The user had tried PS> Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPAddress IS NOT NULL" Get-WmiObject : Invalid query "select * from Win32_NetworkAdapterConfiguration where IPAddress IS NOT NULL" At line:1 char:1 + Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter "IPAdd … + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     […]

under: CIM, PowerShell and CIM, PowerShell and WMI

Microsoft Edge Browser

Posted by: | October 13, 2015 Comments Off on Microsoft Edge Browser |

For the most part I’ve been quite happy with the new Edge browser in Windows 10. One of the irritations was that I could only have one instance open at a time. This appears to have been resolved in the Windows Insider Preview build 10565 which allows multiple instances.   Nice

under: Windows 10

NSlookup in PowerShell

Posted by: | October 13, 2015 Comments Off on NSlookup in PowerShell |

nslookup.exe is a command line executable that is used to discover the IP address of a remote machine from its FQDN. The results look something like this: PS> nslookup powershell.org DNS request timed out.     timeout was 2 seconds. Server:  UnKnown Address: Non-authoritative answer: DNS request timed out.     timeout was 2 seconds. Name:    […]

under: DNS, PowerShell

Scripting Games September 2015

Posted by: | October 5, 2015 Comments Off on Scripting Games September 2015 |

The puzzle for September is here http://powershell.org/wp/2015/09/05/september-2015-scripting-games-puzzle/   with the write up published here http://powershell.org/wp/2015/10/03/2015-september-scripting-games-wrap-up/   Personally I don’t like the approach as it leads to code that’s difficult to read and maintain. I much prefer a simpler more verbose approach that is maintainable.

under: PowerShell, Scripting Games

Windows PowerShell in Action, Third Edition

Posted by: | October 3, 2015 Comments Off on Windows PowerShell in Action, Third Edition |

PowerShell in Action by Bruce Payette has been THE book for the PowerShell expert to learn how PowerShell works under the covers. If you  wanted to know how PowerShell works and why it works the way it does – this was the book.  PowerShell in Action second edition was written when PowerShell 2.0 was the […]

under: Books, PowerShell

Quick update check

Posted by: | October 2, 2015 Comments Off on Quick update check |

Want to check on any updates that haven’t been fully applied in your environment.   Run this on your WSUS server (2012 R2) £> Get-WsusUpdate -Classification All -Status Any -Approval AnyExceptDeclined | where InstalledOrNotApplicablePercentage -ne 100   You can modify the filters:   Classification = one of All, Critical, Security, WSUS   Status = one […]

under: PowerShell, Windows Server 2012 R2, WSUS

Strings and collections

Posted by: | October 1, 2015 Comments Off on Strings and collections |

A question on the forum brought up a point that often confuses PowerShell novices.   QUESTION: What’s the difference between $computers = ‘W12R2SUS, W12R2DSC’ and $computers = ‘W12R2SUS’, ‘W12R2DSC’   ANSWER: The first is a string PS> $computers.GetType() | ft -a IsPublic IsSerial Name   BaseType ——– ——– —-   ——– True     True     String System.Object   The […]

under: PowerShell Basics

« Newer Posts