Creating a SharePoint 2010 Site Structure Using PowerShell

Posted on 14 CommentsPosted in Scripts, SharePoint 2010

In a previous post I detailed how to use PowerShell to perform what would be otherwise done using PSConfig to create an initial SharePoint Farm. In this post I will continue the example and show how to create your web applications using a simple XML configuration file and a reusable script. Like the previous example I have a very basic XML file that defines my web application structure. In this example I’ve included not only […]

Getting an SPWebApplication object using PowerShell

Posted on 4 CommentsPosted in PowerShell Cmdlets, SharePoint 2007

A SharePoint deployment isn’t much of a deployment if there are no web applications.  A web application in SharePoint contains one or more content databases, each of which can contain one or more site collections, etc., etc.  The SPWebApplication class has tons of methods and properties for directly or indirectly manipulating all things related to web applications – you can do backups, add content databases and site collections, set alert settings, manipulate the web.config file, […]

Changing the Application Pool Identity via STSADM

Posted on 2 CommentsPosted in SharePoint 2007, STSADM Commands

This past week I presented at the local Colorado Springs SharePoint User Group meeting on using and customizing STSADM.  The talk was really less about STSADM and more about SharePoint administration tips, tricks, and best practices – but we did create a new STSADM command from scratch during the meeting.  I’ve taken what we did during the meeting and reworked it to add proper validation and help documentation and have included it in my download […]

Un-Extend Web Application

Posted on Leave a commentPosted in SharePoint 2007, STSADM Commands

You may have read my recent post regarding a bug with SharePoint which occurs when you create or extend a web application using an invalid directory path.  I found that the fix for the bug was pretty simple and just required updating the invalid path property so that the unextendvs or deletewebapp commands could work.  What I decided to do was to update the deletewebapp command with this code and create a new command which […]

Extend Web Application

Posted on 8 CommentsPosted in SharePoint 2007, STSADM Commands

I had some free time one night and decided to work on something that I’d had several people ask me about – extending a web application programmatically. Honestly I was surprised at how many people had specifically asked me to create this command. To accomplish this I created a new command: gl-extendwebapp. Note that I’m starting to prefix my commands (something I should always have been doing) and I will eventually set all commands to […]

BUG: Absolute Path Information Required

Posted on 2 CommentsPosted in SharePoint 2007

I got an interesting email the other day from Chakir Said regarding a bug that he encountered with SharePoint. He mis-typed the folder path for the web application and unfortunately the UI page has no validation to make sure that a valid path was specified. The result was that a web application was partially created and the invalid path was preventing the web application from being deleted – any attempts to delete would result in […]

Create Content Database

Posted on 2 CommentsPosted in SharePoint 2007, STSADM Commands

It’s pretty easy to create a content database via the browser and you can create a new content database easily enough when creating a new site collection via stsadm, createsiteinnewdb, or directly using addcontentdb. But what if you need to script the creation of a new content database without creating a site collection and you need to set some of the properties found via the browser that addcontentdb doesn’t provide? To do this I created […]

Add User Policy for Web Application

Posted on 4 CommentsPosted in SharePoint 2007, STSADM Commands

I needed to create this command in order to solve an odd permissions problem that I was experiencing. I had a web application (http://teamsites) which I’d setup and needed to start migrating sites to. When I went to create the site collection using createsite I got the following error: "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" (I got the same "Access is Denied" error when I attempted this via central admin). After doing some […]

Delete Web Application

Posted on 7 CommentsPosted in SharePoint 2007, STSADM Commands

I had just finished creating the gl-createwebapp command and was about to go and delete the test web applications that I had created while testing the command and I discovered that there is no built in stsadm command for deleting a web application. I took a look at the code that is called when deleting via the browser and decided that it was simple enough that I could recreate it as a command – can’t […]

Create Web Application

Posted on 36 CommentsPosted in SharePoint 2007, STSADM Commands

It’s been a couple of weeks since my last post – I’ve been traveling and taking some needed vacation time. But I’m back to work now and I’ve got a couple new commands that I just created today. One nice to have for our company was to be able to specify the home directory (virtual directory path) for our web applications – we didn’t want to use the default value that gets set when you […]