Author Archives:

Managing SharePoint feature state with PowerShell

This is a small function that wraps the Get-SPFeature, Enable-SPFeature and Disable-SPFeature to control state of farm, site or web scoped features. I makes it a breeze to set the state of the built-in SharePoint features during a PowerShell deployment. function EnsureFeatureState( [Parameter(Mandatory=$true, Position=0)] [string] $id, [Parameter(Mandatory=$true, Position=1)] [bool] $enabled, [Parameter(Mandatory=$false, Position=2)] [string] $site) { [...]

Shrink all SQL Server logfiles

After backing up the log files on a SQL server, the logs are truncated and you might want to reclaim the disk space held by those empty log files. This little Transact-SQL script will do just that. DBCC SQLPERF(logspace) GO DECLARE @logsize AS INT = 256; — MB DECLARE @databasename AS VARCHAR(256); DECLARE @filename VARCHAR(256); [...]

Minimalist’s build script for ASP.NET projects

When deploying ASP.NET web sites you have a number of options ranging from full blown (up) MSI installers, MSDeploy or the KISS option: xcopy deployment. If the target IIS set up this is a very clean way to redistribute your application. First download a 7za.exe archiver and put it in your solution root. Then create a [...]

SharePoint List Performance (or how I saved 94%)

In a recent performance test session, I had created a thousand documents in a document library. They all had a 20 custom metadata fields filled out with data. The unit under test read all this data along with the common file information like this: SPUser user = listItem.File.CheckedOutByUser; result.CheckedOutBy = user != null ? user.LoginName [...]

DecoratorStream

In scenarios where you want to extend functionality of a simple System.IO.Stream instance, it is convenient to have a decorator. Neither the original stream or the client instance will have to know anything about the extension as it is still just a Stream. This can be used to add position tracking or to manage lifetime. [...]

Follow

Get every new post delivered to your Inbox.