Display “Private Properties” of a cluster resource using PowerShell and C#

As with all other product management technologies, the Failover Cluster management API is moving to PowerShell.  Over the past few month the product group has released information about using PowerShell to gather information about a failover cluster and its resources.  In this blog post, I am going to focus on a couple of the basic…


What is the deal with KB 2260240 and its cousin KB 2742596–MS13-004?

The purpose of this particular blog post is to try and clear up some of the confusion swirling around about these two KBs and describe the circumstances under which one can expect to encounter the particular issue that KB 2260240 was designed to fix.  What I am hoping is that this blog post will help…

1

Setting Active Directory Object permissions using powershell and System.DirectoryServices

There are times when you have the permission to set discretionary access control (DACL) entries, however you are not  a member of the domain administrators group.    However, when you use the System.DirectoryServices namespace, you are unable to write the DACL entries back to the Active Directory object.  By default, the Active Directory attempts to write…


Using Powershell cmdLet “Compare-Object” to compare WMI objects

Recently I came across a scenario where one of the developers wanted to automate to produce a list of Products that are not installed on a box, compared to a reference server. He was looking for a  powershell solution for the same. If you are familiar with WMI, you may obviously want to explore the…


Using PowerShell History ( Part 1 )

I like trying to figure out how things work and most of the time, it is via trial and error. Then I experiment to test my understanding and discovery a few new tricks along the way. Most of the time, this discovery happens while I am in the Windows PowerShell Console. One of the things…


Using a CSV file to create users by accessing the System.DirectoryServices namespace from a powershell script

There are several ways to programmatically create users in the Active Directory. The easiest way would be to use the Active Directory PowerShell Module. This is great if you have access to a Windows 2008 R2 domain controller as the Active Directory PowerShell Module was made available to manage the Windows 2008 R2 domains. Unfortunately,…


Using the global error collection stored in the $Error variable to retrieve detailed error information in a powershell script

I was recently working with a developer who wanted to know if there is a way to get the error when they call the Invoke-Expression cmdlet. He was using the $LastExitCode to determine if it succeeded or not. Unfortunately, the $LastExitCode was not returning the error he was expecting. A better way of checking for…


Using a customer application event log to debug a Powershell Script

Often, when I am debugging a developer’s PowerShell script, the only symptom I get is that the script is not working. In general, it is fairly easy to debug a small script even when you have little information but when given complex script, it can be difficult to navigate your way around especially when you…


Automating the silent deployment of RemoteApp and Desktop Connection.

I have a customer that was trying to automate the RemoteApp and Desktop Connection but couldn’t find any information that shows you the steps on how to do this. First, there is a feature on Windows 7 and Windows 2008 R2 called  RemoteApp and Desktop Connection, which provides Administrators the ability to group and personalize…


How does variable typing affect simple floating point arithmatic operations in Powershell, i.e. what is 1.1 – 1.04 ?

PowerShell is a great scripting language. You can get complex results by just a one liner, which would have taken a couple of lines in the other scripting languages to generate the same output, but don’t be surprised if you find a simple subtraction 1.1 – 1.04 won’t give you the correct answer of 0.06….