I'm slowly trying to revise my main web site. The original site had a script library page where all of my old Mr. Roboto scripts resided for download. Unfortunately, in many of the online Mr. Roboto articles the link they provided doesn't work now. So if you are looking for my old scripts, use this direct link: http://www.jdhitsolutions.com/scripts.htm. The Mr. Roboto scripts will be at the bottom of the page.
I was looking at my current Mr. Roboto column “Polish Your Shell” on learning PowerShell by starting with 3 basic commands and noticed a lengthy and serious comment. I’ve always felt PowerShell is easy to use and learn, which was the point of my column. However, the comments paint a different story and one that I feel is more pervasive.
I’m afraid the comment is representative of how PowerShell is perceived by many IT admins. They don’t have time to learn anything new or their hair is constantly on fire (to borrow a favorite Jeffrey Snover phrase). Even though the concepts of cmdlets, parameters and a pipeline seem easy and practically self-apparent, they are not. Especially for an administrator who has never had to open a command window before. Granted GUI-based admin tools might have been cumbersome, but at least you could make some educated guesses about how to use it. A command line is very different.
Many of us in the PowerShell community have been involved with PowerShell for so long that I think we forget, I know I do, sometimes what the experience is like the first time you see a PS prompt. So what’s my point?
First, if you are a PowerShell professional, don’t forget what it was like the first time you saw a PS prompt. What can you do to help administrators learn, adopt and embrace PowerShell?
Second, how did you first approach using and learning PowerShell? Did you buy a book or take a class? Did you read the user guide? Did you even know there is a user guide? Do you have any newbie best practices?
Finally, I hope you’ll take a minute to read the original Mr. Roboto comments and let me know what you think. Is he right? Do you agree? Disagree? Are there directions you think Microsoft should take for future PowerShell versions?
PowerShell is here to stay and is only going to spread further into your datacenter. How do we make this process as easy and painless as possible?
I know I haven’t posted much this month. I’m trying to get a new blog setup where I can offer more value and especially an easy way for you to download script and code samples. In the mean time you can find me on “InterTubes” at Mr. Roboto, Prof. PowerShell and The Lonely AD Administrator. Or you can follow me on Twitter.
Thanks for sticking around.
This month’s Mr. Roboto column offers a script you can use with PowerShell to build a domain password report. There were few issues that came up which have since been resolved. You can download the latest version, currently 1.2 at www.jdhitsolutions.com/scripts in the Mr. Roboto section.
My September Mr. Roboto column covers a PowerShell script you can use to create a domain password report. I also demo’d the script at the NYC Techmentor conference this past week. Since then I realized a mistake in the way that I laid out the script. I had nested a function within another function which worked fine for most of the script when I called the outer function. However, I was also calling the nested function directly which was causing the error. The solution was to move the nested function and make it the first function in the script. This way it can be used by the other function and the rest of the script.
I’ve posted an updated version of the script at http://www.jdhitsolutions.com/scripts in the Mr. Roboto section. It will have a 1.1 version number.
Please be aware this isn’t the speediest of scripts and as with all scripts, make sure you test in a non-production environment first.
The registration deadline for the first Techmentor conference of the year is almost upon us. I’ll be doing sessions on using Powershell to manage Active Directory, PowerShell and WMI, Logon Scripts and more. Plus, I’m always happy to hang out and chat. I always have a great time. Hope to see you there.
If you haven’t already registered for TechMentor San Francisco, you can receive a $695 discount on the Gold Passport if you register using priority code TPHIC. More at www.techmentorevents.com/sf. But hurry because the deadline is almost here.
A few of my recent Mr. Roboto columns have been about group auditing. I first published an HTA that would report on group membership last December. Astute reader Matt V. found a bug with the way nested group memberships were being reported. Or in this case, not being reported. It turns out that if a group was a member of one other group, that membership was not reported. But if the group was nested in 2 or more groups then you’d see all the nested groups. After a little debugging I found my goof. I used ADSI to get a reference to the specified group:
<span class="kwrd">Set</span> objGroup=GetObject(<span class="str">"LDAP://"</span> & strDN)
strDN would have a value like CN=Sales,OU=Groups,DC=Mycompany,DC=local. My mistake was in assuming that the MemberOf property would always be a collection so I was using a ForEach construct. But it is only a collection if there is more than one group. So I modified the code:
<span class="kwrd">If</span> IsArray(objGroup.MemberOf) <span class="kwrd">Then</span><br /> Trace <span class="str">"MemberOf is a collection"</span><br /> <span class="kwrd">For</span> <span class="kwrd">Each</span> member <span class="kwrd">In</span> objGroup.MemberOf<br /> Trace <span class="str">"found member of "</span> & member<br /> strMemberOf=strMemberof & <span class="str">" "</span> & member & VbCrLf<br /> <span class="kwrd">Next</span><br /><span class="kwrd">Else</span><br /> Trace <span class="str">"found member of "</span> & objGroup.MemberOf<br /> strMemberOf=strMemberof & <span class="str">" "</span> & objGroup.MemberOf & vbcrlf<br /><span class="kwrd">End</span> If
Because I used the same code in a followup article where I released a command line version of the tool, I had to modify that tool as well. The above code snippet is actually from the WSF version.
Anyway, both versions have now been updated and are available for download from the Mr. Roboto section of my script library. Thank you Matt for keeping me on my toes.