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

Posta Tuscan Grille – A Review

The other day I went with a friend to a restaurant I didn’t know existed – Posta Tuscan Grille in the Marriot across from the Jimmy John’s (not to be confused with Sosta or Tosca). It’s a nice looking place although we didn’t get the full dining experience as Lenovo had taken over. Imagine this filled with discussions about ThinkPads and the latest meme:

posta1

If we had counterfeited some Lenovo name tags, we would have had a free lunch. Instead, we were sent to the bar area which was nice (pretty much the same theme) but had more of a hotel feel.

Our waiter arrived quickly, provided us with drink, lunch, and special menus and was very helpful and professional. He also said that if we get something from the one-page lunch special menu, it’d come out quickest. I ended up having lasagna from the main menu ($15) which looked like this:

posta2

Sorry, I dug into it prior to the picture! I would tell you the fancy name of the sauces and other details, but I assumed their online menu would have the description and it’s not even on there. Suffice to say, the left side was one of the best sauces I’d ever had. It was a buttery cream that wasn’t too rich and if I had a jug I would’ve asked them to fill it and add a straw. Ok, that’s a bit gross but you get the idea. The right side was good too but the left was just too good.

My friend had something off of the quick menu, a veggie sandwich with Caesar salad on the side instead of the fries:

posta3

It was good, nothing wrong with it but probably wouldn’t order again. The bread was good and soft. It held together. I believe it was $10.

I would definitely recommend this place, especially if you’re with a client. The food is good and it’s a little pricey but at least the quality is there. The server could’ve visited one more time to freshen the drinks but he made up for that mistake by giving us a couple of their Tuscan fries to try (well seasoned, slightly limp, good).

I’ll have to go back to try their pizzas “from the bricks” or have that lasagna again.

Bolt – A Review

I ate at Bolt Bistro & Bar for lunch today. It’s a very attractive place. I sat belly up to the bar. The lunch menu (pdf) has some interesting things like Atlantic Salmon with caper berries and sautéed spinach for $13, the Rigatoni Bolognese for $12, or Lobster Mac n Cheese for $10. Items are a little more expensive than average $10 – $15. One salad sounds good, their “Meatball & Salad”, which has a blend of beef and pork, guanciale, tomato sauce, ricotta crème fraice, and garlic crisp served with their Bolt salad for $10.

bolt1

The owner (guy on left) and presumably the manager (guy on right) both visited to see if I was enjoying myself. None of the others visited me though. L

bolt2

I had the “Beef Short Ribs Sandwich” on a toasted brioche roll with horseradish cream and hand cut fries for $12:

It was good, incredibly tender (including the bread) and the fries were slightly limp and seasoned. They may have been the truffle fries. The portion size was plenty and if you find me passed out in my office today, you’ll know why.

Not the best short ribs sandwich I’ve ever had but it was plenty good. I’ll be back to try that Lobster Mac n Cheese and the Blackened Shrimp Taco. They have a frequent lunch card where your 7th lunch is free.

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.

 

Sawasdee – A Quickie Review

I have eaten at every Thai restaurant around town and this always ranks #1. I tend to order their Drunken Noodles Chicken which is my favorite. I get it “3 stars” spicy but have had it up to 5. Oh they’ll make it spicy! I was tearing up. The Pad Thai is the best I’ve ever had. I also recommend their Pad Prik Kra Paw Chicken which is an amazing dish with the most intoxicating smell. For an appetizer, I recommend the Satay chicken with the peanut sauce. The chicken can be a little tough sometimes but the flavor makes up for it. A lot of people I know love the Heaven Beef but it’s just not my favorite. I’ve also had their red curry which is top notch. The Kra Paw Catfish is a favorite of friends who can’t quit it to try something else. Try this place against any other Thai place in town and see where you go back to.

Buku – A Quickie Review

Looks nice but the food is simply ok. The pho is fine, will get you through, but nothing to write home about. Their other dishes are the same. The Banh Mi sandwich is lackluster but again, it’ll get you through. Every dish seems to be missing that something they don’t put in the grocery store cookbooks. Overall, this place seems more focused on the after party than the food. Go for drinks then go eat somewhere else.

Centro – A Quickie Review

The food is excellent across the board but it just seems a bit overpriced. The portion sizes are a little small. Problem is that I can never escape this place for less than $16 for lunch. Maybe it’s because I have to pay for my chips and salsa? I really haven’t had a dish I didn’t love so go for what looks good because it will be. I’ll keep going back because it is that good but I’d go more if it weren’t so expensive.