Joel's SharePoint Architect Blog

SharePoint 2013 Training, Architecture, Administration and Development

Subscribe Subscribe  View Joel Jeffery's profile on LinkedIn
joelblogs.co.uk | joelj.co.uk | joeljeffery.co.uk | jfdiphoenix.co.uk

Category : SharePoint 2010

This question was asked by one of my (most excellent) students this week:

In an ASP.NET Web Part for SharePoint, when I override CreateChildControls(), do I need to invoke the base?

You will see many examples on the Internet of code that does invoke the base, and many counter examples. Some of these contradictory examples are on the Microsoft MSDN site!

I decided to take ILSpy to the System.Web.dll assembly and find out once and for all.

First of all, System.Web.UI.WebControls.WebParts.WebPart does not override CreateChildControls() itself.

System.Web.UI.WebControls.WebParts

So, we must take a look at it’s ancestor: Part.

System.Web.UI.WebControls.WebParts.Part

Once again, there is no implementation for CreateChildControls() here, so we go further up the chain to System.Web.UI.WebControls.Panel:

System.Web.UI.WebControls.Panel

Still no definition of CreateChildControls(). Further up, we get System.Web.UI.WebControls.WebControl.

System.Web.UI.WebControls.WebControl

But it is not until we get to System.Web.UI.Control that we have an implementation:

System.Web.UI.Control

Hang on a moment! That’s empty!

// System.Web.UI.Control
/// <summary>Called by the ASP.NET page framework to 
/// notify server controls that use composition-based 
/// implementation to create any child controls they contain
/// in preparation for posting back or rendering.</summary>
protected internal virtual void CreateChildControls()
{
}

So, the simple answer appears to be:

No, you don’t need to invoke base.ControlChildControls() in an ASP.NET WebPart”

Technorati Tags: ASP.NET, Development, SharePoint 2010, SharePoint Development

SharePoint Doctors - Live SharePoint Help for Admins and DevelopersWe’ve just launched a new service!

If you’re a SharePoint Administrator, and you need help with installing or configuring SharePoint

If you’re a SharePoint Developer, and you want SharePoint Development help to know the best way to code a particular SharePoint solution…

If you’re a SharePoint Power Information Worker, and you’re stuck for help with SharePoint Designer, workflows, Excel Services, Access Services or InfoPath

…then you might just need the SharePoint Doctors!

We are certified SharePoint subject matter experts with real world SharePoint experience, and we’re Microsoft Certified Trainers.

We’re on call for live SharePoint support through video chat and desktop sharing, Monday to Friday, these hours:

GMT: 8am – 8pm

CET: 9am – 9pm

EST: 5am – 5pm

PST: 1am – 1pm

EDT: 6pm – 6am

By prior arrangement, we can also take bookings outside these hours.

Help is available from $100 for a 30 minute consultation, with video chat based live assistance and screen sharing. You can also book us for 30 minute, 1 hour, half and full-day appointments.

Visit sharepointdoctors.com for more information, and check out our credentials!

Updated SharePoint 2010 Google Maps Web Part (v1.2)

There’s an updated version of the SharePoint 2010 Google Maps Web Part available for download here: http://sp2010googlemaps.codeplex.com

We’ve fixed a bug with multi-line labels. :o)

Works on-premise, in the Sandbox and in Office 365.

Technorati Tags: Development, Office 365, SharePoint, SharePoint 2010, SharePoint Development, Solution Sandbox

Ever lost your Farm password?

Farm Password Recovery in SharePoint 2010

The other day I was asked by a customer, “hey, would you happen to have a copy of our Farm password anywhere?”

No, I didn’t. And it would kind of be bad if I did!

However, I could recover SPFarm passwords and recover other Application Pool account passwords for them, once Remote Desktopped in to one of the SharePoint servers.

If you want to recover the Farm password, you need to sign in with a Local Administrator account on a server running Central Admin.

If you want to recover one of the Web Application or Service Application passwords, then you need to log in to one of those servers instead.

IIS 7.x runs Central Admin in the context of an Application Pool running under the Farm Account credentials. Similarly, Web Applications and Service Applications run in App Pools with their own credentials.

To recover any of these, start up an Administrative command prompt or PowerShell window, and IIS Manager 7.x.

In IIS Manager, you need to find out the name of the Application Pool.

IIS Showing Application Pools

For Central Admin, that would be:

SharePoint Central Administration v4

But we can also uncover the passwords for other Application Pools, e.g.:

SharePoint – 80

SharePoint Web Applications

e4b4b94050634ad2863ad7d7d17c3a17

Next, at the command prompt (or PowerShell) you can use the IIS appcmd.exe to request the Password field from the ProcessModel section of the applicationHost.config file. For example, in PowerShell (on ONE LINE!):

&$env:windir\\system32\\inetsrv\\appcmd.exe list apppool 
 "SharePoint Central Administration v4" /text:ProcessModel.Password

An example run is shown below:

Extracting Passwords for Application Pools in IIS

Hope this helps someone!

Technorati Tags: PowerShell, SharePoint, SharePoint Administration

SharePoint Documentation Kit (SPDocKit)

I need to tell you about something fantastic.

SharePoint Documentation Kit – SPDocKit Review

I’ve been using SPDocKit from Acceleratio for about 6 months now, on and off. One of the services we offer at JFDI Phoenix is our SharePoint 2010 Farm Health Check, and this involves a lot of boring navigation through Central Admin and some gnarly PowerShell to gather farm insight. Collecting settings information by hand is tough and time consuming.

The value-add for customers comes from what I can deduce from their configuration – what problems they’ll see; whether their platform will scale; whether it will be secure enough.

SPDocKit helps me gather the vast majority of the information I need, and formats it into a very detailed, very useful report in Word format.

Here’s just a snippet from the table of contents:

SPDocKit Table of Contents

It goes on to produce a detailed inventory of each server in the farm:

Farm Overview

It even builds a Visio-style diagram showing the farm topology. OK, I know it looks daft when I run it on a one-server farm, but it is vastly more impressive on a multi-server farm!

Farm Topology

It also identifies and lists:

  • Services on server, per server
  • Site topology (site collections per web application)
  • Web applications
  • Self-service site creation settings
  • Alternate access mappings
  • IIS settings
  • Site collection usage
  • Quota templates
  • Service applications
  • Detailed settings for each application
  • Databases used
  • Permissions
  • Associations to web applications and proxy groups
  • Content databases, usage and quotas
  • System settings, including email and SMS settings
  • Features and solutions
  • Sandbox configuration
  • Monitoring and reporting
  • Security
  • Administrators
  • Managed accounts
  • Service accounts
  • Products and versions
  • Scheduled tasks
  • Server information
  • Hardware / cores
  • Installed programs and hotfixes
  • Drives and free space

If this wasn’t enough, it also lets you record all this information and monitor changes over time.

More Features!

And there’s more! The SPDocKit application itself has a pretty useful UI. You can browse the web application and site structure without needing to generate documentation:

Site Explorer

It also lets you walk the permissions of your sites. Very useful if you’ve been breaking inheritance and you want to know who has access to what. Having said that, SharePoint’s built-in “Check Effective Permissions” button is still invaluable to debugging permissions problems.

Permssions Explorer

There’s also a Detailed Permissions report, but this is still a very interactive tool:

Detailed Permissions

There’s even best practices analysis built in:

Best Practices

Although obviously not exhaustive, it does give a very good start for a more detailed analysis of a farm.

There’s also a Scheduled Tasks viewer:

Scheduled Tasks

Conclusion

Whilst SPDocKit is not magic, it certainly saves me a great deal of time on SharePoint farm health checks. The licensing is pretty cool also. You can either buy it for an individual farm, of have a yearly subscription as a consultant. If you’re using the latter, the setup exe lets you run it on a server without leaving it installed afterwards.

Technorati Tags: SharePoint 2010, SharePoint Administration, SharePoint Architecture