How Do I Get-Started With PowerShell?

Commands in PowerShell are called cmdlets (pronounced "command lets") and they are in the form of singular verb-noun commands like Get-Alias (not Get-Aliases). In my opinion, there are three cmdlets that are the key to figuring out how to use PowerShell and finding help when you need it. These cmdlets are: Get-Help (help) Get-Command (gcm) Get-Member (gm) Get-Help or Help for short. Help isn't actually an alias, but it works exactly the same way if your using the PowerShell ISE. I've Read more [...]

Using PowerShell to Ace the Scripting & Regular Expression Interview Question

Last week I saw a tweet that referenced a couple of interesting articles on interview questions for programmers. I'm no programmer, but one of them (Steve Yegge's The Five Essential Phone-Screen Questions) had an interesting question about identifying which of 50,000 web pages had phone numbers in them. You have to identify all of the web pages with phone numbers hard coded in them. All of the web pages are HTML files in a directory tree under a folder named website. The phone numbers are in the Read more [...]

Confusion on PowerShell Parameterized Functions

I've run into an issue with PowerShell functions that I don't understand. I guess my confusion is most of the examples I've found online and in books don't work the way the authors explained (at least not for me). The problem is when I define a parameter inside a function, that parameter is not accessible when running the script. When I move the parameter outside of the function, it's accessible and it works without issue. I'm guessing this is because of Read more [...]

Where Do I Find This Thing Called PowerShell?

If you’re running Windows 7, you already have PowerShell 2.0 installed. It’s located under “All Programs > Accessories > Windows PowerShell”. I’m running a 64bit version of Windows 7 so I have both 64bit and 32bit (x86) links in my start menu. I prefer the PowerShell ISE (Integrated Scripting Environment) as apposed to the PowerShell Console. I use the 64bit version and have never run into an issue where I needed to use the 32bit (x86) versions. According to the Microsoft Support Read more [...]

Get-WmiObject : The RPC Server is Unavailable. (Exception from HRESULT: 0x800706BA)

This week while working with some PowerShell scripts that retrieve WMI information from remote servers, I ran into an issue where I was able to return results from Windows 2008 R2 servers without issue but was unable to return results from Windows 2008 (non-R2) servers even though they had PowerShell 2.0 installed and as far as I could tell they were configured exactly the same as the Windows 2008 R2 servers. Here's the error I received: Get-WmiObject : The RPC server is unavailable. (Exception Read more [...]

Your Search Cannot Be Completed Because This Site Is Not Assigned To An Indexer.

Your attempting to search a SharePoint 2010 Site (Foundation Edition) and you receive the following error message "Your search cannot be completed because this site is not assigned to an indexer." Search has never been configured for this SharePoint farm so we'll be configuring it from the ground up. First you'll need two service accounts, one for the search service to run as and one for the actual crawling. Todd Klindt has a great blog on service accounts that I use for reference. I used the Read more [...]

Installation of SQL Server Features from the Command Line

I'm installing a line of business application that requires the SQL Server Management Studio and Client Tools Connectivity be installed as a prerequisite. I want to script this instead of having to manually click through the GUI for the installation since this will be installed on several servers. I've mounted the SQL Server 2008 R2 ISO on "Z" drive. The following command will produce the desired results: At first, I thought that the CONN parameter was incorrect Read more [...]

Set EqualLogic PS Series SAN Volume ACL’s using PowerShell

Query and return the current Access Control List (ACL) for an EqualLogic PS Series SAN volume named "mikefrobbins" using PowerShell: You can see the same information using the GUI: Remove the current ACL’s using the following PowerShell command: Once again, you can see the same information using the GUI: Add new ACL’s using the following PowerShell command: You can also Read more [...]

Unable to Grant Domain Local Groups Full Access Permission to a Exchange 2010 Mailbox using the GUI

John Doe is a user in your Active Directory environment (Windows Server 2008 R2 Forest Function Level) with a mailbox on the email server (Exchange Server 2010 with SP2): You want to grant a domain local group named "Test Group" the full access permission to John Doe's mailbox: You attempt to grant this permission by selecting "Manage Full Access Permission" from the Exchange 2010 Management Console: When you click add and search for the group, it doesn't appear: PowerShell to Read more [...]

Oh Where, Oh Where Have My Group Policy Options Gone?

You are unable to find specific GPO options such as “Compatibility View” settings for Internet Explorer. One of the first things to look at is: Where are the policy definitions being retrieved from? The default for an Active Directory environment is from the local machine as shown in the image below: If you’re editing the GPO on a domain controller and have multiple domain controllers that are running different operating system versions, the available options will vary from machine Read more [...]

Open a SharePoint Document Library with Windows Explorer

When attempting to open a SharePoint document library from a machine running Windows Server 2008 or 2008 R2 by using the “Open with Explorer” button as shown in the image to the right, you receive:  “Message from webpage > Your client does not support opening this list with Windows Explorer.”: To resolve this problem, enable the “Desktop Experience” feature on the machine you are attempting to open the document library from (the client machine): You can also enable the "Desktop Read more [...]

Add an Additional Web Front-end Server to an Existing SharePoint 2010 Farm using PowerShell

You've followed the instructions in my other three blogs and built a SharePoint 2010 farm (not a stand-alone installation) with one or more web front-end servers. Per one of the notes in a TechNet article I found:  “As a best practice, we recommend the operating system on the new server should be at the same service pack level and have the same security updates and other hotfixes as the existing farm servers.”  This article also shows the steps that I’ll be demonstrating in this blog. All Read more [...]

Reset the SharePoint 2010 Passphrase with PowerShell

You’re attempting to add an additional web front-end server to your SharePoint 2010 farm and find out the passphrase you've documented is incorrect or it isn't documented. Resetting the passphrase is a fairly simple process. Open PowerShell and execute the following script. Enter the new passphrase when prompted: Most other blogs on this subject use the code shown in the image below, but why would you want the password to be shown in clear text when Read more [...]

Installing SQL Server 2012 RC0 on Server Core

Last week, I published a blog on Installing SQL Server Denali CTP3 on Server Core and then SQL Server 2012 RC0 was made available for download so I thought I’d write an updated blog since the issues I ran into with the installation seem to be resolved. One of the new features in SQL Server 2012 is official support from Microsoft for installation on Server Core. There’s an MSDN article on “Install SQL Server 2012 on Server Core” and another MSDN article on “Install SQL Server 2012 from Read more [...]

Installing SQL Server Denali CTP3 on Server Core

One of the new features in SQL Server Denali CTP3 is support for installation on Server Core. There’s an MSDN article on “Installing SQL Server Denali on Server Core” and another MSDN article on "Install SQL Server Denali from the Command Prompt" that has a detailed list of all the different parameters. Based on the first article, the setup routine should enable and/or install all of the necessary prerequisites, but that simply isn’t the case from what I found. If you just run setup Read more [...]