Creating Custom SharePoint 2010 Cmdlets using Visual Studio 2010

Posted on 5 CommentsPosted in Article, PowerShell Cmdlets, SharePoint 2010

With SharePoint 2010 we now have the ability to create custom PowerShell cmdlets that can be deployed just like any other SharePoint artifact using SharePoint Solution Packages (WSP) created with Visual Studio 2010. With SharePoint 2007 it was necessary to build a custom setup (MSI) package which had to be run on every server in the farm. This setup package would register a custom snap-in that you’d have to create which would be responsible for […]

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, […]

PowerShell CmdLet Name Changes

Posted on Leave a commentPosted in PowerShell Cmdlets, SharePoint 2007

Ever since I released my PowerShell CmdLets I’ve been unhappy about my choice to use the -gl in the name of the cmdlet.  I felt it would be useful for numerous reasons but I didn’t like that it “broke the rules” of cmdlet naming conventions.  And then Microsoft announced, via the PowerShell team blog, that some code will be added to V2 to enforce the prescribed naming conventions.  You can find the post here: http://blogs.msdn.com/powershell/archive/2009/04/16/increasing-visibility-of-cmdlet-design-guidelines.aspx.  […]

Getting an SPFarm object using PowerShell

Posted on 3 CommentsPosted in PowerShell Cmdlets, SharePoint 2007

There are several core SharePoint objects that PowerShell programmers may need to work with in order to manipulate SharePoint via PowerShell scripts.  Getting these objects is pretty simple but not all that intuitive to users who are still trying to learn PowerShell and the SharePoint API. The SPFarm object is the top level object for working with SharePoint and it provides access to all the global settings for all servers, services, and solutions that are […]

Working with SPWeb(Info) Objects Using PowerShell

Posted on 5 CommentsPosted in PowerShell Cmdlets, SharePoint 2007

I know, I know, I’m way behind on documenting my PowerShell cmdlets – I will be striving to get them done as soon as possible.  I’ve already documented one of them, the Get-SPSite cmdlet, and I will now continue with the Get-SPWeb cmdlet.  Hopefully I’ll be able to wrap up the others much quicker as they are a lot simpler – then I can finally start building new ones 🙂 Like the Get-SPSite cmdlet the […]

Working with SPSite(Info) Objects Using PowerShell

Posted on 6 CommentsPosted in PowerShell Cmdlets, SharePoint 2007

One of the first PowerShell cmdlets I built, Get-SPSite, addresses some common issues found with working with SPSite objects.  I struggled with how I could provide a means to quickly and easily get SPSite objects while at the same time helping administrators so they don’t have to worry (as much) about object disposal.  For those that aren’t familiar with the SPSite object (Microsoft.SharePoint.SPSite), it’s the equivalent programmatic element for working with site collections. What I […]

Recalculating Usage Statistics via STSADM or PowerShell

Posted on 8 CommentsPosted in PowerShell Cmdlets, SharePoint 2007, STSADM Commands

I was perusing through the SharePoint forums the other day and I came across an issue that someone was having with the usage statistics information for their My Sites site collections.  When they viewed the usage data (~site/_layouts/usage.aspx) they were seeing incorrect information.  I’m not really sure why the numbers were wrong but fixing them turned out to be pretty easy.  There’s a public method called “RecalculateStorageUsed” that, when called, will recalculate the usage statistics […]

Initial Release of My SharePoint PowerShell Cmdlets

Posted on 10 CommentsPosted in PowerShell Cmdlets, SharePoint 2007

Update 4/25/2009: I’ve removed the “-gl” suffix from all my cmdlets – any examples using the -gl in the cmdlet name should be updated. If you’ve been following my blog you’ll remember that I recently pushed out a “beta” build of some SharePoint PowerShell Cmdlets for some initial feedback and reviews.  We’ll I’ve gone ahead and incorporated the feedback that I received and I am now officially releasing the first version of my cmdlets.  The […]

My New PowerShell Cmdlets for SharePoint 2007: Feedback Requested!

Posted on 10 CommentsPosted in PowerShell Cmdlets, SharePoint 2007

Okay all you PowerShell superstars out there that have been using my STSADM commands – I need your help!  I’ve decided to teach myself PowerShell and see if I can’t leverage some of my STSADM experiences/code to expose some SharePoint functionality and I need some people who really know this PowerShell stuff to please take a look at what I’ve got so far and let me know if I’m way off base or not. My […]