Category: PowerShell

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 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 [...]

Use PowerShell to add an additional Domain Controller to an existing Windows Server 2012 Active Directory Domain

Recently, I decided to add a second domain controller to my domain. The existing server and this new server that will become a domain controller both run the Microsoft Windows Server 2012 operating system and both were installed with the default installation type of server core (no GUI). Even though the GUI can be turned on and off in Windows Server 2012 (unlike in Windows Server 2008 and 2008 R2), I prefer not to add the GUI unless absolutely necessary. You've already loaded Read more [...]

Reminder: Mississippi PowerShell Users Group Meeting Tonight!

Tonight from 8:30pm to 10pm Central Time I'll be presenting at the first ever Mississippi PowerShell Users Group online (virtual) meeting. The topic for my presentation is "Parsing the Event Logs of Windows Based Systems with PowerShell". We'll start out with a basic overview via a few PowerPoint slides: Next and for the majority of the meeting, I'll be demonstrating how to parse the event logs using PowerShell. This will include how to figure out what cmdlets can be used to parse the event Read more [...]

Become a PowerShell SuperHero with SAPIEN Technologies PowerShell Studio 2012

I saw a tweet last week titled "The Friday Funny: The Best T-Shirts at #RSAC" and while those t-shirts are cool, they're not nearly as awesome as the ultimate technology related T-Shirt which is from SAPIEN Technologies and when combined with their PowerShell Studio 2012 product can turn you into a PowerShell SuperHero as seen in the following image: Note: The PowerShell enthusiast depicted in the previous image is not an actual superhero, he is only portraying one.  Seriously, the T-Shirt Read more [...]

Use PowerShell to Remotely Enable Firewall Exceptions on Windows Server 2012

You're attempting to view the event logs of a couple of remote Windows Server 2012 servers that have been installed with the default installation type of server core  (No GUI). You receive the following error when attempting to connect to these servers using the Event Viewer snapin in an MMC console: "Computer 'DC01.MIKEFROBBINS.COM' cannot be connected. Verify that the network path is correct, the computer is available on the network, and that the appropriate Windows Firewall rules Read more [...]