Category: PowerShell

Welcome to PowerShell Hell

I finally figured out why the error messages in PowerShell are in bright red. It's because it's the color of flames and/or red hot coals and it means you may be in PowerShell Hell. That's what recently happened when I updated the Antivirus on my PC from Eset NOD32 version 4 to version 5. A few days after updating, I was in PowerShell Hell as shown below: When trying to run Get-ChildItem against WSMan:localhost, I received the following: Get-ChildItem : WS-Management cannot process the request. Read more [...]

Places to Learn More About PowerShell at TechEd

Stop by the Scripting Guys booth in the Connect Zone area at Microsoft TechEd North America 2012 to learn more about PowerShell: Here's The Scripting Guy (Ed Wilson) at the Scripting Guys booth yesterday while he was talking about my guest blog on the Hey, Scripting Guys! Blog (displayed on the monitor): Also stop by the Windows Server 2012 Server Manager & PowerShell booth in the Technical Learning Center area: µ Read more [...]

PowerShell 3.0 Hands-On Labs at TechEd 2012

Thinking about learning the new features of PowerShell 3.0 at Microsoft TechEd North America 2012? If you're planning to get some hands on experience using the hands on labs, don't waste your time. I attempted to go through the WSV11-HOL "What's New in Windows PowerShell 3.0 " this morning: Only to find out the resolution (screen size) on the virtual machine is set too high to view the content: I also attempted the WSV12-HOL "Introduction to Windows PowerShell Fundamentals 3.0 ", but had the Read more [...]

Use PowerShell to Audit Logon Authentication Type

Want to know what type of authentication mechanism is being used when users log onto your servers? This script pulls the information from the event logs to determine how users are being authenticated. It uses Get-Winevent with the -FilterXPath parameter. That parameter and what the logon type numeric codes translate to are a couple of things that I haven't seen much documentation on. The script sorts by server name in ascending order and then by the time in descending order. I've Read more [...]

Adding PowerShell Snap-in’s and Locating Added Cmdlets

Want to make the SharePoint 2010 cmdlets available for use from the PowerShell ISE? Some products such as SharePoint 2010 provide their application specific PowerShell cmdlets via a PowerShell snap-in instead of a PowerShell module. The following commands are being run from the PowerShell ISE on a SharePoint 2010 web front-end server. To view the snap-ins that are available to add, run the following: The SharePoint 2010 snap-in is installed on the machine, Read more [...]

Using PowerShell to Find Expiring SSL Certificates & the Websites they’re Associated with

Have you recently received a notification about an expiring SSL certificate and don't remember where all it's used at? It's generally not an issue to figure this out with normal certificates which are issued for a single name, but if it's a wildcard certificate, it could be used on lots of different websites within your organization. The following PowerShell script retrieves all of the SSL certificate's thumbprints and their expiration dates on an individual server that has IIS installed (This has Read more [...]

Using the Quest Active Directory PowerShell Snapin to Search For & Set Attributes

I want to make sure that all users in a specific OU in my Active Directory domain have the "Deny this user permissions to log on to Remote Desktop Session Host server" option set (checked): Download the Quest Active Directory PowerShell Snapin (free). The PowerShell command shown below searches this specific OU in my Active Directory domain for users where this attribute is not equal to false. The default setting is blank (allowed) as shown with the Gill Bates user below. Read more [...]

Rename an IIS Web Application with PowerShell

Want to rename an IIS Web Application on a Windows 2008 R2 server? It's not possible from the GUI, but it's simple to accomplish using PowerShell. First, let's create a web application in an existing website and then verify it exists: Here it is in the GUI: Rename the web application using PowerShell and then verify it was renamed: Here it is again in the GUI showing that it has indeed been renamed: µ Read more [...]

Create a New IIS Website with PowerShell

On a Windows Server 2008 R2 machine, IIS has already been installed and you want to create an additional website. If necessary, an additional IP Address has been added to the server also. Use the New-Website PowerShell cmdlet to accomplish this task: You can get a list of websites running on the server by using the Get-Website cmdlet or by running Get-ChildItem on the IIS PSDrive: µ Read more [...]

Use PowerShell to Check the Firmware Version on an EqualLogic Storage Area Network

I received an email recently stating that I hadn't downloaded the most recent version of firmware for multiple EqualLogic Storage Area Networks that I support. What's the easiest way to check what firmware version an EqualLogic SAN is running? PowerShell of Course! You'll need the EqlPSTools PowerShell Module which is part of the EqualLogic Host Integration Tools (HIT) kit for Microsoft that can be downloaded from the EqualLogic support site. Once this module has been installed, you'll be able Read more [...]

Symantec Backup Exec 2012 Adds PowerShell Support!

The latest version of Backup Exec, version 2012 adds support for PowerShell. When Backup Exec 2012 is installed, it adds a PowerShell module named "BEMCLI": You'll need the .NET Framework 3.5.1 installed to be able to import this module: I'm guessing this .NET Framework 3.5.1 issue is an oversight since the typical installation installs the .NET Framework 4.0, but doesn't enable 3.5.1: Enable the NET-Framework-Core Windows Feature. You'll have to import the server manager module (Import-Module Read more [...]

Is PowerShell 2.0 Installed by Default on Windows Server 2008 R2?

As with most things in IT, the answer is that it depends. It depends on whether or not the server was installed with the Full Installation or with the Server Core Installation. It also depends on what your definition of installed is. If the server was installed with the Full Installation (GUI) then PowerShell is installed (enabled) by default, but if it was installed using the Server Core Installation (no GUI) then PowerShell is not installed (not enabled) by default. If you attempt to Read more [...]

New PowerShell Cmdlets added with the EqualLogic HIT Kit version 4.0.0

The EqualLogic Host Integration Tool kit for Microsoft version 4.0.0 adds 12 additional PowerShell cmdlets to the 55 that existed in version 3.5.1 for a total of 67 cmdlets. The release notes state that firmware version 4.2.0 or later is required for the HIT kit v4.0.0 PowerShell tools. The syntax of several of the existing cmdlets also changed which appears to be mostly the addition of new parameters. See the release notes which are included as part of the new HIT kit that can be downloaded from Read more [...]

Set-WSManQuickConfig Error When Running PowerShell Enable-PSRemoting Cmdlet on Web Server

I recently ran into an issue when trying to access one of my Web Servers with PowerShell remoting. Here's a simple test to show the error: My first thought was that PowerShell remoting wasn't enabled on the target computer. So let's try to run this without remoting: No luck with using that route either. I headed over to the web server and ran the Enable-PSRemoting Cmdlet and received another error: "Set-WSManQuickConfig : The client cannot connect to the destination specified in the request. Read more [...]

Interesting How People are Claiming to Have Same Beginner 1 Solution as the Expert Solution but Still Did Not Get 5 Stars

This past weekend I posted a blog about Beginner Event #9 of the 2012 PowerShell Scripting Games and I received a comment on it from @ruddawg26. I took a look at his profile and tweets. I found a tweet that was tweeted by him "Interesting how people are claiming to have same beginner 1 solution as the expert solution but still did not get 5 stars #2012SG" so I decided to investigate further which is how this blog came to be. There's a blog article on the Hey, Scripting Guy! blog: "Expert Commentary: Read more [...]