Archive for May, 2009

How to generate a GUID

Found this on Serge van den Oever’s blog. This is useful when designing SP features.

From http://weblogs.asp.net/soever/archive/2007/05/31/generate-a-list-of-guid-s.aspx:

Sometimes you just need a lot of GUID’s while programming. Of course you could use the Visual Studio GUID tool, but that is a lot of work.

Open a PowerShell console, and paste in the following line to get a list of 100 guid’s:

$i=100; while ($i– -gt 0) { Write-Host ([System.Guid]::NewGuid()) }

Here’s a sample of the output:

4b7a20f4-05bb-4bc4-ba6d-09672134c47f
3d5cd6f7-a5dc-4085-947f-0dd580b395f4
36228424-e107-4f0e-bc3d-15177853cdf2
0ba362af-6723-422a-b1b4-c73b0a9eb5dd
90879793-a8cf-41ea-bfe2-38c774ef2037
7904b9dd-efd5-494e-9385-64117036e62a
48ad6baa-6cbf-4c51-b152-e8a9924e8301
3e0a1eda-894f-4967-8a9e-488e99be0689
ebf18ecc-e8e3-468c-aa17-3dcdb4499b67
44ec2ba5-8914-4472-a1b2-24f63f9d224b
490f066a-29f0-4124-8c0c-2809e450849e
35f73b5b-8bbb-4567-8d46-fb0d18a2e5e4
fac47264-d32a-42bc-a6ae-06f522eff8fd
1168d57d-87ee-46c7-88a2-945c23171952
31ba1403-844b-43f5-851e-cb5e60752413
06fa2676-4273-4b19-afeb-ca585b1c5744
6fb792cc-e19a-40c5-9180-a26f188acce4
82ede030-19bd-4dae-acbd-bb2f889ef4f7
cb8207cb-a1ed-4fc8-a9dc-b130dfaa238b
0bf13d6d-b197-44d3-bc15-763131b19dac
50a4297e-2ed2-4cae-ae81-835cafbd13b3
722f3065-ada9-4925-97ee-219e8cc7a919
f0b61e6d-bb48-4a09-bb21-58de9a408a3c
57892674-ed4e-4935-931a-46986dd4e46b
f0367cfb-fbc4-461b-87dd-1cbb2f647eca

Advertisements

Governance structures

Matt Moore posted this in the SIKM Leaders newsgroup on Yahoo, and I found it very useful to help think about the governance structures we use. This could apply to SharePoint governance as well as KM or other systems and frameworks…

From http://tech.groups.yahoo.com/group/sikmleaders/ on 5/26/09:

KM governance issues often remind me of political models:

– Are we China? [Top-down control with minimal accountability and heavy sanctions for disagreement]
– Are we the UK? [Centralized governance model with some accountability]
– Are we the US? [Demarcated split between “Federal” and “State” control]
– Are we Switzerland? [Most of the power lies in the regions with a relatively weak central government]

Of course, many organisations might be uncomfortable with these analogies.

Matt Moore

Force autologon after logging off

This isn’t strictly SharePoint-related, but might be useful to a sysadmin somewhere…

I have a few servers that are running old-fashioned console apps (meaning that there always has to be a specific user session logged in for these apps to run properly). The server is configured with an autologon feature so when the system is restarted (after patching or a power outtage), the apps are also automatically restarted.
Sometimes these apps will stop responding, and we need to restart them using a script; however, we don’t want to restart the entire server.
The problem I ran into was, if you just log off the user session, it doesn’t automatically log back in – it gets stuck on the username/password screen.

It turns out, there is a registry setting that controls this behavior. Here it is:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\ForceAutoLogon

This is a string value; if you set it to 1 (and configure the remaining registry values for auto-logon), then when you log off, Windows will log you right back in.

WSS 3.0 Service Pack 2 error

I tried installing Windows SharePoint Services 3.0 Service Pack 2 update on my Test farm last night and while running the Configuration Wizard, I encountered this error:

Failed to upgrade SharePoint Products and Technologies.
Failed to upgrade SharePoint Products and Technologies.
Further information regarding this failure can be found at
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\LOGS\Upgrade.log.
An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown.
Additional exception information:
Failed to upgrade SharePoint Products and Technologies.
Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException:
Exception of type ‘Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException’ was thrown.

Well, the first step in resolving this type of issue is to read the error message carefully. 🙂 It’s a fairly generic error, but in the message body, it’s referencing the Upgrade.log file for more info; so I opened that file, and found the following:

[SPManager] [ERROR] [5/17/2009 9:43:26 PM]:
Access to the path **********\web.config’ is denied.
[SPManager] [ERROR] [5/17/2009 9:43:26 PM]:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

Next step, located the web.config file, checked the properties, and bingo! – web.config file attribute was set to Read-only!
This must’ve happened last time the file was deployed.

Uncheck the Read-only checkbox, click OK, rerun the Configuration Wizard, and everything worked beautifully…

Enumerate SharePoint sites and subsites using PowerShell

Here’s a simple Powershell script that will enumerate all sites and their sub-sites in your SharePoint environment.

 


[System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") | out-null

$oContentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService;

[Microsoft.SharePoint.Administration.SPWebApplicationCollection]$waColl = $oContentService.WebApplications;

$waColl1 = $waColl | where-object {$_.IsAdministrationWebApplication -eq $FALSE}

foreach ($wa in $waColl1)
{

$waName = $wa.Name

$sites = $wa.Sites

foreach ($obj in $sites)
{
$siteurl = $obj.Url.Replace("http://","").Replace(":","").split("/")

$site=new-object Microsoft.SharePoint.SPSite($obj.Url)

for($i=0; $i -lt $site.AllWebs.Count;$i++){

Write-Output $site.AllWebs[$i] | Select Url; ##Send through Pipeline

$site.Dispose(); ##ENFORCED DISPOSAL!!!

}

}

}

SharePoint SSP crawl error

After the latest round of MS patches, I started experiencing the following symptoms on my SharePoint farm:

1) Can no longer browse to SharePoint sites locally on the server
2) Search engine crawl broke with the following error:

“Access is denied. Check that the Default Content Access Account has access to this content.”

I tried re-entering the account password for the search crawler account, but it didn’t work. The fix was to disable LoopBackCheck in the registry (as found in this KB):

http://support.microsoft.com/kb/896861

Also, this Technet forum has a pretty good discussion on the topic:

http://social.technet.microsoft.com/Forums/en-US/sharepointsearch/thread/84f93fbe-f4a6-4683-b25b-b595b9006ad7

No need to restart server or make any other changes – as soon as the registry value is created, things start working beautifully.

Read Steve’s post in the forum, there are some words of caution here:

Steve03820
Friday, May 01, 2009 2:51 PM0 votes

This issue was caused by the .NET Framework 3.5 SP1 & Family Updates, in that the authentication methods for communication between the specific SharePoint services were changed. The DisableLoopbackCheck does in fact work, but I expect it will be the cause for additional headaches in the near future when additional Service Packs are released.

For the time being, remember to make this change on all SharePoint Servers in your farms. If not, you have additional problems, such as incredible latent pages, the application pools shutting down unexpectedly – yes…actually shutting down, and corrupting your content databases to the point that Content Deployment ad Quick Deploy will no longer work.

Fun Stuff

– Steve

Automatic Updates service fails to start

After I installed Service Pack 2 on my Windows XP workstation, the Automatic Updates service failed to start with the following error:

The Automatic Updates service terminated with the following error:
The class is configured to run as a security id different from the caller.

After some searching online, I found out that this problem is created when certain Administrative security templates are applied to a computer before installing XP SP2. I finally came across the solution here:

http://www.wsuswiki.com/AutomaticUpdatesServiceTerminated

The solution turned out to be a one-line command entered at the command prompt:

SC sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
Here’s the output:
AutomaticUpdates Fix

After I entered it, the AU service started beautifully…

Now I have to figure how to resolve a pesky TFS error message and fix the search index in my SharePoint farm…


RSS Information Week Headlines

  • An error has occurred; the feed is probably down. Try again later.

RSS SharePoint Team Blog

  • An error has occurred; the feed is probably down. Try again later.

RSS InfoPath Team Blog

  • An error has occurred; the feed is probably down. Try again later.

RSS Joel Oleson Blog

  • An error has occurred; the feed is probably down. Try again later.

RSS Susan Hanley’s KM Blog

  • An error has occurred; the feed is probably down. Try again later.

Blog Stats

  • 353,733 hits