Category Archives: SharePoint

Update Web Part on a Page Using Powershell in SharePoint 2010

I recently had to update a web part’s zone id that existed on most pages throughout the SharePoint 2010 site. I wrote up this powershell script to address this. DISCLAIMER: Use at your own risk!

  $site = new-object Microsoft.SharePoint.SPSite(“http://your_site”)
  foreach($web in $site.AllWebs)
{
    #Make sure you specify which page needs changes
    $page = $web.GetFile(“default.aspx”)
    $page.CheckOut()
    $wpm = $web.GetLimitedWebPartManager($page.Url, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
  #$wpm.WebParts | ft
  $wp = $wpm.WebParts | Where-Object { $_.Title -eq “Page Tabs” }
  #$wp.ZoneID | ft
  $wp.ZoneID = “Header”
  $wpm.SaveChanges($wp)
  $page.CheckIn(“Update via PowerShell”,[Microsoft.SharePoint.SPCheckinType]::MajorCheckIn)
  $wp.ZoneID | ft
}
$web.Close()
$site.Close()

I left the commented lines in since they can be helpful as well.

Query Tool for Raw Web Service Search Results for SharePoint 2007 & 2010 (FAST and Enterprise)

CodePlex has two great tools to query your SharePoint 2007 or 2010 search which return raw XML so you can see exactly what is going on in your results.

Fast Search For SharePoint MOSS 2010 Query Tool – Ok, they need to work on the title a bit and the background is just a terrible idea but the thing works for both FAST and Enterprise Search on 2010. It allows you to choose Scope, edit the Default Columns, and a lot more. It’s mostly intuitive to use. Just make sure to change your “Results Provider” to “SharePoint” if you’re using Enterprise instead of FAST.

SharePoint Search Service Tool – This is for SharePoint 2007 and works just as well as the previous one. It has less options but gets you your XML results quickly and edit the query as needed. Plus, a nice background!

SharePoint 2007 Search Service Tool

Downgrading from SQL Server 2008 R2 Enterprise to SQL Server 2008 R2 Standard

I recently had to downgrade from SQL Server 2008 R2 Enterprise down to Standard with SharePoint 2010 Enterprise installed. It turned out to be surprisingly easy, thanks to this thread. One issue will likely come up. Search won’t work and you’ll get this error:

Database ‘[name]‘ cannot be started in this edition of SQL Server because part or all of object ‘MSSDocSdids’ is enabled with data compression or vardecimal storage format. Data compression and vardecimal storage format are only supported on SQL Server Enterprise Edition.

Unfortunately you’ll have to recreate search. This post references any issues with that. The same might be true for your Web Analytics Service Application with an error like this:

EVENT 5586: Database ‘WebAnalyticsDatabaseName’ cannot be started in this edition of SQL Server because it contains a partition function ‘DateIdPF’. Only Enterprise edition of SQL Server supports partitioning.

Nevertheless, here are the steps that worked for me. Be sure to follow them to the letter.

  1. Take a good backup of all of your databases (system and user).
  2. Run SELECT @@VERSION and note the specific build number of SQL Server that you are currently on.
  3. Shut down your existing instance of SQL Server.
  4. Copy the master, model, and msdb database files (both mdf and ldf), don’t move them copy them, from the current location to a new folder that you mark as readonly.
  5. Uninstall SQL Server from the system.
  6. Reboot the server.
  7. Install SQL Server Standard Edition.
  8. Apply the necessary Service Pack and/or Cumulative Updates to bring the instance up to your previous build number.
  9. Shutdown SQL Server.
  10. Copy the master, model, and msdb database files (both mdf and ldf) from the folder you saved them in to the correct location for the new install and remove the readonly flag from the files, and change the file ACL’s so that the SQL Service account has Full Control over the files.
  11. Startup SQL Server and if you did it correctly it will startup and be exactly where you were before you made any changes, with all of your user databaes online and you should be ready to let applications connect and resume operations.

The whole process took less than two hours. Good stuff.

 

SharePoint 2007 and 2010 April 2012 CUs Released

Windows SharePoint Services: http://support.microsoft.com/kb/2598130

Microsoft Office SharePoint Server: http://support.microsoft.com/kb/2598129

Office 2007 Cumulative Updates for April 2012: http://support.microsoft.com/kb/2685445

SharePoint Foundation: http://support.microsoft.com/kb/2598321

SharePoint Server 2010: http://support.microsoft.com/kb/2598151

Project Server 2010: http://support.microsoft.com/kb/2598152

Office 2010 Cumulative Updates for April 2012: http://support.microsoft.com/kb/2685449

Chrome net-internals

Why didn’t I know about this before?

If you’re a Chrome user and wish to have very similar Fiddler functionality, it’s already built in. Just go to chrome://net-internals/ and you’ll see a large amount of data with the ability to export. It’s pretty nice!