Tag: PowerShell

2013 PowerShell Scripting Games Advanced Event 3 – Bringing Bad Habits from the GUI to PowerShell

I’m seeing a trend with a lot of PowerShell scripters. Many of us have a GUI, non-scripting background and we moved to PowerShell because we didn't want to be button monkeys clicking through the same options in the GUI day in and day out. I've always heard, if you’re going to do something more than once, do it (script it) in PowerShell. The trend I’m seeing is many are bringing their bad habit of wanting to repeat themselves over and over, day in and day out, to PowerShell. They write Read more [...]

People Who are Blogging About the 2013 Scripting Games

I'm sure that most people can easily find any of the blogs of the official judges from the 2013 Scripting Games. I recommend reading those blogs whether you're competing in the scripting games or not since there's a wealth of great information contained in them. The best place to find those blogs if you don't know already is the Judges Notes section under the Scripting Games area on PowerShell.org so there's no reason to duplicate them here. There are also a number of people who are competing Read more [...]

2013 PowerShell Scripting Games Advanced Event 2 – Why NOT to use the Win32_ComputerSystem WMI Class

The majority of the entries I've seen for the Scripting Games event 2 are using the TotalPhysicalMemory property from the Win32_ComputerSystem WMI class to determine the total amount of physical memory in a server. The property name is "TotalPhysicalMemory" after all so that's what it should contain, right? Not so fast, keep reading to discover why. Your manager needs an inventory of all of your company's physical servers that are located in three different data centers which are in different Read more [...]

2013 PowerShell Scripting Games Advanced Event 2 – Attention to Detail is Everything

Here's my approach to the 2013 PowerShell Scripting Games Advanced Event 2: When I start one of the Scripting Games events, I read and re-read the scenario because if you don't understand the requirements, you can't write an effect script, function, command, tool, etc. It's not a bad idea to print out the event scenario and highlight the high-points. Here's the scenario for Advanced Event 2 -An Inventory Intervention, I'll place the items in bold that I would normally highlight on my printout: Dr. Read more [...]

Lessons Learned from the Scripting Games Advanced Event 1

This is a continuation from my previous blog titled "2013 PowerShell Scripting Games Advanced Event 1 – Parameters Don’t Always Work As Expected". This isn't the exact script, but sections of it. You'll notice at the bottom of the first image shown below, I retrieve the list of folder names from the files variable to keep from having to make another call to the file system. Going from one variable to another in memory is a cheap operation where as going to disk to retrieve something is more Read more [...]

2013 PowerShell Scripting Games Advanced Event 1 – Parameters Don’t Always Work As Expected

The scenario for this event states the following which has been paraphrased: Someone allowed log files to build up for around two years and they're starting to causing disk space issues on the server. You need to build a tool to archive the log files because this has happened more than once. Applications write log files to a sub-folder in "C:\Application\Log". Examples are C:\Application\Log\App1, C:\Application\Log\OtherApp, and C:\Application\Log\ThisAppAlso. The log files have random file Read more [...]

PowerShell Function to Determine the Active Directory FSMO Role Holders via the .NET Framework

Last week I posted a PowerShell function to determine what Active Directory domain controllers held the FSMO roles for one or more domains and forests. That particular function used the Get-ADDomain and Get-ADForest cmdlets which are part of the Active Directory PowerShell module. As it so happens, a friend of mine, Shay Levy who is a PowerShell MVP posted an article on PowerShell Magazine that uses a couple of one liners that use the .NET Framework to return the FSMO role holders. I'm not Read more [...]

Use PowerShell to Find Where the Current FSMO Roles are Assigned in Active Directory

A while back, I had a need to figure out with PowerShell what server in an Active Directory domain held the PDC Emulator FSMO Role. I found a script on a very popular blog site that figured it out by using a command similar to this: While it accomplished what was necessary, I immediately thought "I can do better" and improved the one liner so it filtered left: At the April Philadelphia PowerShell User Group meeting, Read more [...]

Using PowerShell v3 Features to Figure Out the Mysterious PowerShell Pipeline

I actually wrote this blog a couple of weeks ago and postponed it until I could do further testing because I thought of some scenarios where it possibly wouldn’t work. I wrote a couple of new blogs over the past couple of weeks and forgot about this one. Low and behold, I had rescheduled this blog for today and forgot all about it so I had two blogs posted today! I also have to say the PowerShell community is awesome! I had a PowerShell MVP send me a very courteous email that confirmed my previous Read more [...]

Mississippi PowerShell User Group – April Meeting Tomorrow Night!

The April Meeting of the Mississippi PowerShell User Group is tomorrow night, Tuesday April 9th at 8:30pm Central Time (CDT). This meeting will be held online (virtual) via Microsoft Lync, it is open to the public, and free to attend. The necessary software, the Lync attendee client, is also free so there's no cost what-so-ever to attend. SAPIEN Technologies is our sponsor this month and they have provided several items including video training and a few different eBooks which will all be given Read more [...]

The Scripting Games are Coming, The Scripting Games are Coming, The Scripting Games are Coming!

This years Scripting Games are scheduled to be kicked off during the PowerShell Summit North America 2013 which begins on April 22nd. That's about two and a half weeks away at this point. In previous years, there have been two categories and it's my understanding that this year, there will be three categories. One for PowerShell beginners, one for advanced PowerShell scripters as in previous years, and a new category for people who aren't actually competing in the events but want to grade or rate Read more [...]

Book Review: Windows PowerShell Cookbook 3rd Edition

Two months ago I started reading Lee Holmes's new Windows PowerShell Cookbook (3rd Edition). I read the epub version of the book using the iBooks App on my iPad which is my format, app, and device of choice for reading books. The epub version of the book is 1739 pages (the PDF version is 1036 pages). When I first started reading the book, my wife said "How could someone write a book with that many pages in it?" My response was: The guy who wrote this book is one of the guys who works on the PowerShell Read more [...]

Florida PowerShell User Group March Meeting Video and Presentation Materials

The Florida PowerShell User Group March Meeting was this past Tuesday, March 19th. I was the speaker for this meeting and from what I've heard, my presentation was a huge success! The presentation and the Get-History output from the commands that were demonstrated during the presentation can be downloaded from here. Use posh031913 for the zip file password. We recorded the entire "PowerShell Fundamentals for Beginners" presentation: µ Read more [...]

I’m Speaking on PowerShell Fundamentals for Beginners at the Florida PowerShell User Group Meeting Tonight

Tonight, Tuesday March 19th, at 7pm eastern time, I'll be presenting a session titled "PowerShell Fundamentals for Beginners" at the Florida PowerShell User Group meeting: During this presentation, I'll be covering the concepts that were difficult for me to learn when I first started using PowerShell. We'll start out by discussing where to find PowerShell, how to launch it along with issues you'll experience when running the shell as a non-admin as well as execution policy related issues. Then Read more [...]

PowerShell Web Access Error: “Sign-in failed. Verify that you have entered your credentials correctly.”

Scenario: You've partnered with a company who is testing a new software application that uses PowerShell Web Access. You've provided this company with an Active Directory account named "Joe Doe". This account is only allowed to sign into the PowerShell Web Access interface of a server named WWW in the mikefrobbins.com domain. Password policies in this domain use the default settings. Forty-two days after the account was created, you receive an email from the partner company asking if something Read more [...]

Using a PowerShell Quote List Function to Work with an Array of Strings

Reblogged from Mississippi PowerShell User Group: Recently, during one of our test user group meetings that Rohn and I had, I was using an example of storing multiple server names into an array to then work with them. This is how I would normally accomplish this task, that is unless I pulled the names directly from Active Directory: Rohn showed me the way he has been accomplishing this sort of task which requires less typing: I Read more [...]