Posts Tagged ‘SP2010’

Adding a hidden web part to a wiki page

September 28, 2010 Leave a comment

I have a wiki library.  I have a custom web part that by default is hidden.  I add the web part to the page.  It works. 



Ok, that was fun, let’s remove it and get back to work. 

I edit the page again to remove it.  It’s not there.  But it is.  As in, I can see it doing it’s thing, but I can’t manipulate it in any way; can’t grab it by it’s chrome, can’t edit the properties, can’t even click it’s little context menu.  So where is it?  And more importantly, how do I get it off my page again?

Enter SharePoint Designer

If I open the page in Designer, I can find the wee fella.


So if I set the Hidden value to False, and save, I can now see my web part. 


Now I can get to the web part properties, and instead of making it hidden (which I can’t actually do, because it’s disabled), I can set the Chrome to None, thus achieving the same result.

So there solves the mystery of the hidden web part that was visible.

Categories: SharePoint Tags: ,

Deleting the search service application

August 27, 2010 21 comments

The search crawl db got corrupt in my development environment.  After trying to remove the crawl db and component through the UI and being unsuccessful, I decided to just go ahead and blow away the search service app and recreate. 

So I go to the Service Apps page, select the search service, and click delete.  Twenty minutes later, the service is still being deleted.  Not.  Scrap that and head for PowerShell.


Twenty minutes later, still waiting.

Over to the old man stsadm.exe



The SharePoint PowerShell cmdlets are great and all, but sometimes they just don’t work.

Note: To get the id of the service application, you can do one of the following:

From the UI

Navigate to the service applications page.  Mouse-over the search application link, and observe the id in the status bar.

From Powershell

Get-SPServiceApplication |?{$ -eq "Search Service Application"}


Categories: SharePoint Tags:

Essential SharePoint 2010

August 19, 2010 Leave a comment


imageCongratulations to the Essential SharePoint 2010 authoring team.

We received the first copies today and it looks great!


“Essential SharePoint® 2010 approaches Microsoft SharePoint Server 2010 from a strict business value perspective, explaining exactly how to plan and implement SharePoint solutions to achieve superior business results.

Categories: SharePoint Tags: ,

SP2010: Custom logout page

If you use a login mechanism that uses cookies to store your token, you may find the logout option a tad redundant.

What happens is, you choose to logout, get sent to the logout page where you are prompted to close the page, which you probably don’t want to do, then you click the link “go back to site” which on doing so, logs you back in! 

If your authentication provider (ADFS, IDM, etc) has a logout page, then you probably want to redirect them to that.  Or if you want to customize your own logout page, well more power to you!

To change where the  logout link brings you to, you need to modify the Welcome.ascx control template.

Browse to /14/TEMPLATE/CONTROLTEMPLATES and edit the welcome.ascx file.

You can add a property called ClientOnClickNavigateUrl to overwrite where the “log me out” link brings you to.


Once you save this control and refresh your page, you will have a new logout destination!

Categories: SharePoint Tags: ,

Home Networking: Configuring Forefront TMG for Web (and SharePoint) publishing

December 6, 2009 2 comments
Note: I am using this on my home network.  I have not configured this in a production environment.  These are the steps I took to get this working for my network.

After building your bog-standard Hyper-V server with 20Gb RAM, 1Tb HD mirrored, on a quad-core AMD chip (x2), you kinda want to use it as much as you can.  I have used this machine to setup a few personal web site projects, as well as various SharePoint farms.  But more recently I have been using it for SharePoint 2010 testing and exploration. 

I had setup external access to my sites using port forwarding from my D-Link router, but I was having to use a different port for each server.  On top of that, I have a Windows Home Server in the mix, which loves to grab port 80 from my router through UPnP.

Game Plan

Here’s what I’m trying to do.  Have three internal web sites,,,  Make all of these accessible from the internet using Forefront TMG.  Setup Dynamic DNS to manage my dynamic IP.


Forefront TMG – The next generation of Microsoft ISA server.  Forefront TMG will handle traffic for the 3 three web sites. – Will handle the dynamic DNS for me.  There are several alternatives, I just happened to pick this one.

D-Link router – The router will handle directing all traffic to the TMG server on port 80.

SharePoint AAM – We need to configure SharePoint to understand the addresses it will receive.

Windows Home Server – Not a direct player, but it does hijack port 80 from the router, so need to disable this.


  • All web servers have a static IP address.
  • Forefront TMG is already installed and configured.
  • Web Sites are available on port 80
  • you have a valid domain name (e.g. and can manage the DNS for it


    While I was setting this up, I used the local hosts file (c:\windows\system32\drivers\etc) to test 1st that the web site host header (and SharePoint AAM) was working correctly by pointing the web address directly at the server; then by testing the TMG firewall rule by pointing the web address at the TMG server.

Publishing a SharePoint Web Application

The following will setup a rule for a SharePoint web application, the same steps will apply for a standard web application, without the SharePoint configuration piece obviously.

We have our SharePoint site already built and hosting a site collection, so now we need to do the following to get it published at

  • Configure Alternate Access Mapping (see end of this article)
  • Create local hosts entry for SharePoint web server (for testing only)
  • Create Firewall rule in TMG
  • Edit local hosts entry to point to TMG server (for testing only)
  • Configure DNS entry
  • Edit router rules (one time)
  • Disable Windows Home Server Port Configuring service (optional)

Forefront TMG


imageMy configuration for a TMG server is a stand-alone server in a workgroup as opposed to a domain.  Because it’s already inside my network, I have it configured it for a Single Network Adapter.



From the TMG Console, open the Firewall Policy page from the tree on the left.

Before we create a rule for the web site publishing, we need to configure a Web Site Listener (if not already configured). 

Creating a Web Listener

From the Toolbox tab in the right pane, right-click on the Web Listeners folder and select ‘New’.

image image image image

Using the Wizard to enter/select the following:

  • Name: HTTP Web Site Listener
  • Connection Security: Do not require SSL
  • IP Addresses: Internal (Because this is a single NIC network, all requests will come from internal.)
  • Authentication: HTTP Authentication for Basic, Digest, Integrated
  • SSO: No SSO will be available as we are not using Just forms authentication.

Once the wizard is complete, you will see the listener listed in the folder.

Double click to bring up it’s properties and make the following modification.


Under the Authentication tab, click Advanced…

Select to “Allow client authentication over HTTP”.

This is disabled by default as you would typically authenticate over SSL for an external connection.







Now that the Web Listener is created, we will use this when creating our rules.  So on to our Firewall Rule.

Creating a Firewall Rule

Switching back to the Tasks tab in the right pane, select Publish Web Sites

Note: There is also a Publish SharePoint Sites option. From what I could see the only difference is that the wizard asks if you have configured Alternate Access Mapping for the site – it does not seem to do it for you; making it no different to the Publish Web Sites wizard.

image image image image

image image image image

image image

Use the wizard to provide/select the following:

  • Rule Name:
  • Rule Action: Allow
  • Publishing Type: Publish a single Web site or load balancer
  • Server Connection Security: Use non-secured connections
  • Internal Site Name:
  • Internal Publishing Details: Select to forward original host header
  • Public Name Details: Accept requests for this domain name (
  • Web Listener: Select the one created earlier
  • Authentication Delegation: No delegation, but client may authenticate directly
  • User Sets: All authenticated users

Once you are happy with the rules and Web Listener, you need to apply them.  You will see an Apply button at the top of the window.


After the rules are applied, we can test by pointing the local hosts entry at the TMG server IP address.


Router Configuration


In order for us to access this internal web site from the outside, we have to configure the router to handle the traffic accordingly.  My router is the excellent D-Link DIR-655.

The configuration involves setting up virtual servers for the web sites.  Because we are having Forefront TMG handle all the redirection, we only need one virtual server entry that sends all HTTP traffic to the TMG server.

From the D-Link management console (web application), Select Virtual Server under the Advanced tab.



Enter information for a new virtual server that will send all HTTP traffic (port 80) to the IP address of the TMG server.

Now when you apply this rule, all HTTP traffic will be immediately passed to the TMG server to manage.


At this point we can test to see if:

  • Router is forwarding HTTP requests
  • TMG firewall rule is handling correctly
  • Web site AAM is configured correctly
    To test, modify the local host entry to point to the public IP address of your router.  To get this address, browse to from inside the router.


Dynamic DNS


Because this is a home network, running off a cable provider network, I do not have a legal dedicated IP address.  Instead my cable provider allocates me a dynamic one.  Because of this, I cannot directly bind my web address to a static address :(.  This is where DynamicDNS fits in :).  A dynamic DNS address gets updated when the ip changes, this update is handled by a client on the network talking to the DynamicDNS server.

To get DynamicDNS working, you need to register with a DynamicDNS provider ( in this case), and a client to update the server.  There are plenty of free clients out there, but most modern routers can act as a client also.

So I registered at, then I configured my router to updated it.


Now when my cable provider assigns me a new IP address, the router will update accordingly.





At this point, you could test by pointing the entry in the local hosts file at  In order to test this though, you have to configure your firewall rule, IIS host header, and SharePoint AAM accordingly.


Domain Configuration

image All we have to do at our domain provider, is create a CNAME for that points to  Once that propagates, we should be able to ping and have it resolve to our public IP address!



Windows Home Server


The last piece of the puzzle for me was to stop my Windows Home Server from overriding my router Virtual Server settings for port 80.  WHS provides for publishing it’s own web site for accessing pictures, files etc.  It’s actually great, and completely handles you having your own address at, including providing an SSL certificate, and automatically configuring your UPnP router.  This is all great until you don’t want it to :). 

There are a number of ways to tackle this.  you could disable the UPnP feature of your router altogether, but doing this will mean other applications could not use it.  You could disable the service by remoting into your WHS (but WHS can still re-enable it).

I just opened up the WHS console and disabled it from there.  Because I never use it, this is the easiest option for me.


To disable this through the console, Open the settings window and click Remote Access on the left.

Here you can click the Turn Off button to disable the service.





SharePoint Alternate Access Mappings


Lastly, if you haven’t configured SharePoint already (and you probably have to have had successful tests), here’s what you need to do for SharePoint AAM and IIS.

From SharePoint Central Administration, select Configure alternate access mappings in the System Settings group.




On the AAM page, edit the Public URLs (make sure you have selected the right web application).

Enter for the internet url.



image Any changes to the AAM after the web site has been extended for SharePoint, will have to be manually applied to IIS.

Open IIS Manager, and browse to the web application. Right-click and select Edit bindings.  add a new binding for


Note: I’m using Windows server 2008 R2.  So IIS 7 considers host headers as ‘bindings’.  In IIS 6, bring up the web site properties dialog and modify the host headers in there.



Forefront TMG gives you much more control and functionality that what I am currently using it for, however this is all I need right now.  As mentioned before, this is not a production environment.  For a production setup, more attention should be paid to authentication and encryption using SSL.

The same steps apply for creating a standard web application without the need to configure SharePoint.  You will still need to configure IIS bindings however.

Now you should be able to access your externally published SharePoint and Web sites from wherever you are!  No excuses ;).

Categories: SharePoint Tags: