Monthly Archives: February 2013

PowerShell – Book review of : Learn Windows PowerShell 3 in a month of lunches, second edition

About 6-7 years ago at school we were taught how to script using VBscript. I was really bad at it though and never really made an effort to change that. When PowerShell became more popular however I had gained some working experience and was also pleasantly surprised by the simplicity of it.

I started learning about PowerShell scripting by googling and using script examples. Disadvantages of this approach however is that:

  • You can pick up bad habits from others (without realizing it).
  • You sometimes don’t know exactly why you’re doing things a specific way.
  • You sometimes don’t know why some things are/aren’t working.

PowerShell is getting increasingly important though:

  • Even though more companies are offshoring and employees are relatively, it is still cheaper to automate instead.
  • Cost isn’t the only issue, speed is important as well. Scripting allows you to get things done more quickly.
  • PowerShell is increasingly being adopted by more companies, products and (cloud) services.
  • The number of available built-in cmdlets are increasing, which makes it even easier to automate actions.
  • For many products you have to use PowerShell to make specific settings, because only the more basic settings are available in a Graphical User Interface (GUI).
  • Changes can be applied consistently in a development, test, acceptance, pre-production, production environment.
    • Less chance of human error.
    • If done correctly, you’ll also have included a way to quickly revert the changes by script.

To make sure I didn’t miss out on too many things, I decided to start with a book that teaches the basics. Because of the good reputation of the authors Don Jones and Jefferey D. Hicks in the PowerShell community, I decided to go for their book “Learn Windows PowerShell 3 in a month of lunches, second edition” published by Manning Publications Co.

The book’s purposely didn’t try to stuff all PowerShell related information into the book. Instead it provided the reader/student with the basics needed to be able to find/discover this information themselves if needed. I personally like this approach, because otherwise there would be too much information to take in which might be demotivating and distracting.

I also liked the practical examples of common mistakes made by people who are new to PowerShell. There were a lot of examples I ran into as well when I started using PowerShell and I think this will prevent people from becoming frustrated because they understand why things aren’t working the way they might have expected.

All in all this is a great book to start learning PowerShell. This is however just the start and you should expect to continue using other resources/books to further your knowledge. The book also provides links to useful resources as well. And most importantly … start using PowerShell more so you will learn by experience.

Personally I still have these books lying around, but haven’t decided yet which one to start with next:

I’m also still considering taking a PowerShell course, but I’m a bit hesitant about the added value because it’s hard to determine the quality of a course by the description.

If you have experiences or suggestions, please let me know.


Posted by on February 27, 2013 in Automation, ICT, Microsoft, Powershell, Windows


Tags: , , , , , , , , ,

SQL Server Virtual Labs have been updated for SQL Server 2012 SP1

For those looking to get familiar with SQL Server 2012 SP1, Microsoft has updated the Virtual Labs for SQL Server 2012 SP1.

This way you can easily learn and play around with it without having to set up your own lab.


Leave a comment

Posted by on February 27, 2013 in ICT, Microsoft


Tags: , , , , , , ,

PowerShell – Extract specific info from multiple source winaudit files

I run Winaudit on each server/system and save it to a central location named <computername>.csv                 This way I have access to a lot of information about each system. If you need a specific subset of information for each system however, you don’t want to have to open each file manually to get this information.

This script will parse each <computername>.csv to extract specifc information and save it to one new file containing this info for all parsed separate files.


Posted by on February 25, 2013 in Automation, ICT, Microsoft, Powershell


Tags: , , , , , , , , , , ,

PowerShell – Use Get-ADcomputer to get a quick overview of your AD environment

One of the tasks in ICT is maintaining an up-to-date and correct CMDB. This is also a hard task and is often not performed (properly).

Luckily however, with the PowerShell Get-ADcomputer you can get a lot of information directly from Active Directory. Try using: Get-ADComputer -Filter * -Properties *

Ofcourse if you have non-domain joined computers or non-Windows based computers you have to come up with something for that as well.

Personally, I use this command to quickly get info about my Home Lab instead of having to document it manually (with the risk of human error):
Get-ADComputer -Filter * -Properties * | select name,canonicalname,dnshostname,operatingsystem,OperatingSystemServicePack,operatingsystemversion,IPv4address | out-gridview

In the image below you can see what it looks like for me:


You can of course customize it and alter the output method. You could by example add the property Modified to see when it was last changed. You can also add the property Description if this makes sense for you. I did not enter descriptions myself, but for the cluster nodes it has been added automatically and says: “Failover cluster virtual network name account”.


Posted by on February 24, 2013 in ICT, Microsoft, Powershell


Tags: , , , ,

PowerShell – Create-Event

This script will create an event in an existing event log or a new event log.

This can be useful to keep track of what happens in your script either locally or using monitoring tools like SCOM. You can also use it to test if custom event monitoring you’ve configured is working as expected.

Or run a task in response to a given event as explained here.

Leave a comment

Posted by on February 23, 2013 in Uncategorized


Tags: , , , , , ,

Windows 8 – fix for adding to Library error “This network location can’t be included because it is not indexed”

Like many other people nowadays, I have a network share containing my photos, videos and documents. I prefer to access these over the network, which is possible using explorer.

The problem however (especially on my Windows 8 tablet), is that this method in general does not work (properly) for Windows 8 apps. Instead they extensively use the Windows libraries (Documents, Music, Pictures, Videos).

So my first thought was to simply add the content on the network share to the Libraries. Apparently this is not how Microsoft wants it to be used, since I got an error stating: “This network location can’t be included because it is not indexed.”

I don’t need/want it to be indexed though, so I went to look for other solutions and found elaborate step-by-step guides. I also found the Win Library Tool, which simplifies adding an unindexed network location to the Windows libraries.

I still hope Microsoft will make it easier to add unindexed locations to the library though.


Posted by on February 23, 2013 in ICT, Microsoft, Tutorials, Windows


Tags: , , , , , , , , , , , , , , ,

VMware – Free VMware instructional videos

Not every company or person is able to afford training. Luckily however, more and more companies are providing free learning materials.

VMware has recently updated its instructional videos that can be found at :

Leave a comment

Posted by on February 21, 2013 in ICT, Learning, VMware


Tags: , , , , , , , , ,

PowerShell – Get-GroupMemberships

This script determines the group membership of Active Directory users.

In this case, some users are member of multiple functional groups (groupname “*-core”), while the design assumes a user can only be a member a single functional group. This script helps determine the functional groups they are a member of.

Especially with a large number of users, scripting will save you a lot of time.


Tags: , , , , , , , , , , , , , ,

PowerShell – Get network adapter information for all clients in the domain

When a customer was replacing its wireless infrastructure it had to perform an inventory of the wireless network adapters in use to determine if replacements were necessary and for which systems.

To perform the inventory, this script queries active directory for clients and then queries every client for its network adapter.

Unfortunately in this case PowerShell remoting wasn’t available, but luckily remote WMI was possible.

Leave a comment

Posted by on February 19, 2013 in ICT, Microsoft, Powershell, Windows


Tags: , , , , , , , , ,

Powershell – Rename-redirectedprinter

This script renames a redirected printer and sets it as default.

The reason this needs to be done, is because some older programs require a specific (short) printer name and will not work otherwise. With SAPlpd by example the printer name may only consist of x characters, no spaces, etc.

By default however with Remote Desktop Services in Server 2008 R2, a redirected printer will show as “<printername> (redirected <session ID>)” by example “Lexmark X1100 series (Redirected 2)”.

-Renaming a redirected printer is not supported.
-The script assumes there’s only one redirected printer that matches the comment filter.

All the hard work of determining what had to be done was performed by my colleague Peter Scheilen. I just converted it to PowerShell.


Posted by on February 18, 2013 in ICT, Microsoft


Tags: , , , , , , , , , , , ,

%d bloggers like this: