Using PowerShell to create wildcard Managed Paths in SharePoint 2010
Using PowerShell to create wildcard Managed Paths in SharePoint 2010
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 and pass in the web application I want to add the managed path to in order to make sure it's not already there.

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

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.

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

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.

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 .

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).

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
You May Also Like
creating a managed path in sharepoint 2010 with powershell, Managed Paths with PowerShell, Managing Web Applications, New-SPManagedPath, Powershell, SharePoint 2010, SharePoint 2010 PowerShell, sharepoint 2010 poweshell, SharePoint Managed Paths, wildcard managed paths sharepoint 2010
A Simple Introduction to Cisco CML2
0 3804 0Mark 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 603 1This 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
How to Build in a PSMethod to your PowerShell Code
0 71 0In this video, PowerShell instructor Jason Yoder shows how to add Methods (PSMethod) to your code using free software that’s added into the PSObject. For instructor-led PowerShell courses, see our course schedule. Microsoft Windows PowerShell Training Download the Building Methods PowerShell script</a> used in this video. <# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ Building Methods โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโข … Continue reading How to Build in a PSMethod to your PowerShell Code
See what people are saying...