Using PowerShell to create wildcard Managed Paths in SharePoint 2010

Home > Blogs > PowerShell > Using PowerShell to create wildcard Managed Paths in SharePoint 2010

Using PowerShell to create wildcard Managed Paths in SharePoint 2010

Like This Blog 1 Spike Xavier
Added by May 13, 2013

Managed Paths allow us to extend Web Applications to hundreds of thousands of site collections without having to bother the I.T. Administration staff with a bunch of DNS entry requests. It's easy enough to go into Central Administration as a member of the Farm Administrators Group and go to Manage Web Applications and add a new Managed Path. But it's even easier to do via the SharePoint Management Shell!

Here are the steps in this blog:

1. Run Get-SPManagedPath and pass in the web application I want to add the managed path to in order to make sure it's not already there.

2. Run New-SPManagedPath and pass in the web application I want to add the new managed path to.

3. Provide the text for the managed path when prompted for the parameter (in this case "blogs") no quotes are neccessary for a word.

4. Validate the results which will print to the console when the commandlet has successfully completed.

5. Run Get-SPManagedPath and pass the web application (repeat of step 1, try using the up arrow or F7, it's easier) and notice that the blogs wild card managed path has now been added as a Wildcard Managed Path.

6. Using the Managed Path – now that I've got this managed path, might as well use it, I run a New-SPSite commandlet and create a new team site at http://sp360.local/blogs/dw .

7. Create the default associated SharePoint Security Groups (Thanks Lester From Neudesic).

8. Go to the new team site and start working!

One thing to keep in mind is that all of this happened without any new DNS entries. SharePoint managed the whole thing. There is a limit of 20 Managed Paths per Web Application so these aren't something to knock out time after time, but hey this is my dev environment and this thing will most likely be gone by the time you read this blog. There is a difference between Explicit and Wildcard managed paths. Simply put:

Explicit managed path – you type in the url including the managed path and you get the home page of the top level site of a site collection.
i.e. http://sp360.local/ – in this case the / is the explicit managed path (referred to as the root) but I could have created an explicit managed path "portal" and if I did and typed in http://sp360.local/portal I would get the home page of the top level site of the site collection I created at that url.

Wild Card Managed Paths – these can be thought of as placeholders after which you can place site collections. In the case of this blog post I created a wildcard managed path blogs and it was created as a wildcard managed path, so if I type in http://sp360.local/blogs I will get page not found. (The only time I'm happy to see this as a web developer 🙂 ) However I am free to create about 249,998 site collections and have them start after. The site collection I created in this blog is located at http://sp360.local/blogs/dw so the only thing I really did was say, put this site collection at dw which will come after http://sp360.local/blogs/

I run Get-SPManagedPath

I-run-Get-SPManagedPath.png

I run Get-SPManagedPath and pass in the web application I want to add the managed path to in order to make sure it's not already there.

Run new SPManagedPath

Run-New-SPManagedPath.png

Next I Run New-SPManagedPath and pass in the web application I want to add the new managed path to.

Provide the text for the Managed Path

Provide-The-Text-For-The-Managed-Path.png

Now I provide the text for the managed path when prompted for the parameter (in this case "blogs") no quotes are neccessary for a word.

Validate results in shell window

Validate-Results-In-Shell-Window.png

I validate the results which will print to the console when the commandlet has successfully completed.

Run Get-SPMangedPath again

Run-Get-SPMangedPath-Again.png

Now it's time to once again Run Get-SPManagedPath and pass the web application (repeat of step 1, try using the up arrow or F7, it's easier) and notice that the blogs wild card managed path has now been added as a Wildcard Managed Path.

Use the new Managed Path

Use-the-new-Managed-Path.png

I made it, now I'm going to use it. Using the Managed Path – now that I've got this managed path, might as well use it, I run a New-SPSite commandlet and create a new team site at http://sp360.local/blogs/dw .

Create Default Associated Groups

Create-Default-Associated-Groups.png

When you use the New-SPSite to create a new site collection using the Team Site Template (STS#0) you don't get the default associated SharePoint security groups so I always run the CreateDefaultAssociatedGroups on the rootweb (learned this from Lester Sconyers) So in this step I Create the default associated SharePoint Security Groups (Thanks Lester From Neudesic).

Experience the magic

Experience-The-Magic.png

That's it. All done. Thought it, Created It, Using It. PowerShell and SharePoint are quite a pair. Seriously , PowerShell is punk.

Spike Xavier
SharePoint Instructor – Interface Technical Training
Phoenix, AZ

Videos You May Like

A Simple Introduction to Cisco CML2

0 3894 0

Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2

Creating Dynamic DNS in Network Environments

0 642 1

This content is from our CompTIA Network + Video Certification Training Course. Start training today! In this video, CompTIA Network + instructor Rick Trader teaches how to create Dynamic DNS zones in Network Environments. Video Transcription: Now that we’ve installed DNS, we’ve created our DNS zones, the next step is now, how do we produce those … Continue reading Creating Dynamic DNS in Network Environments

Cable Testers and How to Use them in Network Environments

0 725 1

This content is from our CompTIA Network + Video Certification Training Course. Start training today! In this video, CompTIA Network + instructor Rick Trader demonstrates how to use cable testers in network environments. Let’s look at some tools that we can use to test our different cables in our environment. Cable Testers Properly Wired Connectivity … Continue reading Cable Testers and How to Use them in Network Environments

Write a Comment

See what people are saying...

    Share your thoughts...

    Please fill out the comment form below to post a reply.