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

Agile Methodology in Project Management

0 153 0

In this video, you will gain an understanding of Agile and Scrum Master Certification terminologies and concepts to help you make better decisions in your Project Management capabilities. Whether you’re a developer looking to obtain an Agile or Scrum Master Certification, or you’re a Project Manager/Product Owner who is attempting to get your product or … Continue reading Agile Methodology in Project Management

Creating Users and Managing Passwords in Microsoft Office 365

0 642 3

In this Office 365 training video, instructor Spike Xavier demonstrates how to create users and manage passwords in Office 365.   For instructor-led Office 365 training classes, see our course schedulle: Spike Xavier SharePoint Instructor – Interface Technical Training Phoenix, AZ 20347: Enabling and Managing Office 365    

Detailed Forensic Investigation of Malware Infections – April 21, 2015

4 606 5

How does an investigator hunt down and identify unknown malware? In this recording of our IT Security training webinar on April 21, 2015, Security expert Mike Danseglio (CISSP / CEH) performed several malware investigations on infected computers and identify symptoms, find root cause, and follow the leads to determine what’s happening. He demonstrated his preferred … Continue reading Detailed Forensic Investigation of Malware Infections – April 21, 2015

Write a Comment

See what people are saying...

  1. Avatar Chony

    Note on slide 29 when using unique piemrssions, the Visitors group defaults to the parent Visitors group. Remember to click on “Create New Group” at Visitors and it will create a new group for you with your site name. You need to see you site name in all 3 groups. Otherwise all the visitors from the site above will still have access to your site.

Share your thoughts...

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