Business Technology | Solutions for your problems

This post is related to some of the new features found in SharePoint 2010. Since the switch to the new architecture of Service Applications and the passing of the Shared Service Provider things have moved around and there are a whole new set of issues you can get yourself into.

When you are creating My Sites you will notice some things like Ask Me About, Skills, Interests and some other fields are showing an error when trying to edit your profile.

With the introduction of the Service Applications you now need to be sure that you have your Web Applications and Service Applications correctly associated with each other. To get to the association location from Central Admin click on the Application Management link from the quick nav bar. Once that screen opens find the “Configure service application associations” link under the Service Applications section.

You can now configure which Service Applications are associated with the different Web Applications and Service Applications. There is a whole other topic on creating different Application Proxy Groups, but I’m not going to go into that now since it involves using PowerShell.

To solve the error we have found while trying to edit our profile we need to make sure that the Web Application and Service Applications have the User Profile Service Application and Managed Metadata Service in the same Application Proxy Group.

There are 2 different views so you need to make sure both are set. To change the View use the dropdown. Click on the link in the Web Application / Service Application column and on the window that opens make sure both options are checked.

That should fix your problem and make the error message go away.

More fun stuff in 2010!

No tags

Here is a tip about how to prevent your site owner or other users who have access to add web pages from getting an access denied message when they try to edit a page.

Background
You have a site collection with a top level site that you don’t want anyone to access so you remove the permissions from it. Then on your sub-sites you break inheritance so you can get the security set up the way you want.

The Issue
When users go to edit a page to do something like add a web part they are given an access denied error. You can see this even if you have “Full Control” access on the sub-site.

The Resolution
Go to the top level site and create a new Group (ex: WebPartViewers), but don’t give it any access. Next, add the users or groups that you want to be able to add and remove web parts from a page. You could add “Authenticated Users”, but that is probably not a good idea since you will be opening up the web part library with this change.

Now go to the Web Part Gallery by way of Site Actions –> Site Settings –> Modify All Site Settings or navigate to /_catalogs/wp/Forms/AllItems.aspx at the site collection level. Click on Settings –> Gallery Settings. Click on the “Permissions for this gallery” under the “Permissions and Management” column. If you haven’t already, break the permissions so that you can add a new user to the library. Add the group that you created and give it Read access.

Now your users that have the correct permissions will be able to add web parts without getting the access denied error message!

Get to work!

No tags

This is just a little FYI to save you some time. When you do a backup of your SharePoint site it is a good practice to use the stsadm command “setsitelock” so users aren’t making changes that can corrupt the backup. While this is good you need to remember this when you are trying to restore your site. If you find yourself unable to access the site or add users, which are common actions when moving to a dev environment, then be sure to “unlock” your site. Here’s some quick commands you can put in a batch file for backing up and restoring your sites. Have fun!

Backup.bat
@echo off
IF “%1″ == “” goto err
IF “%2″ == “” goto err2
setlocal
set SITE=%1
set FILENAME=%2

ECHO Backing up %SITE%
stsadm.exe -o setsitelock -url %SITE% -lock readonly
stsadm -o backup -url %SITE% -filename E:\BackupFiles\%FILENAME%
stsadm.exe -o setsitelock -url %SITE% -lock none

if not errorlevel 0 goto err

goto success

REM error message if no argument or site does not exist
:err
echo.
echo Site URL is required.
echo Here an example:
echo.
echo BackupSite.bat http://my.sharepoint.site site.bak
echo.
echo.

REM error message if no argument or site does not exist
:err2
echo.
echo Output file name is required.
echo Here an example:
echo.
echo BackupSite.bat http://my.sharepoint.site site.bak
echo.
echo.

:success
echo %SITE% backed up successfully

Restore.bat
@echo off
IF “%1″ == “” goto err
IF “%2″ == “” goto err2
setlocal
set SITE=%1
set FILENAME=%2

ECHO Restoring %SITE%
stsadm -o restore -url %SITE% -filename E:\RestoreFiles\%FILENAME% -overwrite
ECHO Unlocking %SITE%
stsadm.exe -o setsitelock -url %SITE% -lock none

if not errorlevel 0 goto err

goto success

REM error message if no argument or site does not exist
:err
echo.
echo Site URL is required.
echo Here an example:
echo.
echo RestoreSite.bat http://my.sharepoint.site site.bak
echo.
echo.

REM error message if no argument or site does not exist
:err2
echo.
echo Output file name is required.
echo Here an example:
echo.
echo RestoreSite.bat http://my.sharepoint.site site.bak
echo.
echo.

:success
echo %SITE% restored successfully

Update:
With the release of SP2 the site is automatically set to read-only so you don’t need to include this in your batch file. However, if you don’t want it to be set as read-only then you need to run the backup command with the -nositelock option.

No tags

One thing you lose when you create a data view of a slide library is the ability to just show a thumbnail without some custom work. It’s not difficult, just a pain. Here’s the code so you don’t have to waste time thinking about something that should be built in. Note: This works for ppt and pptx files. You’ll have to think to make the rest work!

<td class=”ms-vb”>
<xsl:variable name=”fileExt” select=”concat(‘_pp’,substring-after(@FileLeafRef, ‘.pp’))” />
<xsl:variable name=”fileName” select=”substring-before(@FileLeafRef, ‘.pp’)” />
<img border=”0″ src=”/{@FileDirRef}/_t/{$fileName}{$fileExt}.jpg” />
</td>

No tags

Need to open access to your SharePoint site for anonymous access, but don’t want them browsing your lists and libraries? Just activate the lockdown feature!

Set your web site up for anonymous access in Central Admin under Authentication providers. The next step is to log on to your server and open up a command prompt so you can run a stsadm command.

If you haven’t added it already then you need to make sure the path is set to include C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN.

Next run the command:
stsadm -o activatefeature -url -filename ViewFormPagesLockDown\feature.xml

Now you can go the permissions for your site and edit the permissions to allow access to the entire site. Your users will not be able to get to your lists and libraries to view what is in them, but you can still expose the items for users to get to through web parts on your pages.

One last thing to note is that if you already have anonymous access turned on to your site it will appear like this command does not work after your run it. You need to go to your site and turn off anonymous access and then turn it back on for it to work.

Good luck with your public sites!

No tags

I had the pleasure of working with a client recently on an issue that was described to me only as “there was a problem with the Internet and then SharePoint stopped working.” With such an in depth explanation to the problem I knew exactly where to start, the logs!

After looking over SharePoint’s logs and the event logs, I was seeing errors dealing with the Network Service account not having access to the database and database does not exist type errors. This gave an indication that it could be a corrupt database.
Now the setup here for this client is a personal server running Windows 2003 R2 SP2 with WSS 3 SP1 and using Windows Internal Database SP2.
The first thing I did was look for the backups. Unfortunately the person that did the install of SharePoint did not configure the backups to run. I went to my second option and asked the IT guy in charge of the network if he had backups scheduled on the server. No luck there either.
The next thing I did was run through all of the Windows Updates that hadn’t been applied and pushed those out to the server. I did choose to not apply WSS SP2 since I was already dealing with a database issue so I didn’t need that update attempting to alter the database and making things worse.
Once all of the updates were run I downloaded the SQL Express Management Studio so that I could take a look at the databases on the box. Sure enough once I connected I was able to see the Content database marked as Suspect. At this point I had to put the database in emergency mode so that it would allow me to attempt to recover anything I could. Here is a script that will help you with the recovery process. You need to make sure you don’t run the entire script at once because you may need to alter it after you run DBCC CHECKDB the first time. Once you run the check it will tell you what your options are for recovery based on it’s analysis. Be sure to read the analysis file carefully so you don’t run a higher level of recovery than is required.

-- Turn on Update
exec sp_configure 'update','1'
reconfigure with override
GO
-- Set database to Emergency so you can access data
ALTER DATABASE WSS_Content
SET EMERGENCY
GO
-- Set to Single User so you can perform maintenance
ALTER DATABASE WSS_Content
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
GO
-- Run CHECKDB. Check log when complete for possible solutions
DBCC CHECKDB (WSS_Content)
-- Run suggested method to repair database
DBCC CHECKDB (WSS_Content, REPAIR_ALLOW_DATA_LOSS)
-- Set Database ONLINE
ALTER DATABASE WSS_Content
SET ONLINE
GO
-- Set to Multi User so everyone can access
ALTER DATABASE WSS_Content
SET MULTI_USER
WITH ROLLBACK IMMEDIATE;
GO
-- Turn off Update
exec sp_configure 'update','0'
reconfigure with override
GO

After executing the script I finally had SharePoint back up with minimal data loss and the client was happy! She had all of her documents and images uploaded to the server and would have lost a year’s worth of work.
To wrap everything up I created a batch file that will backup the database and scheduled it to run weekly. I also recommended to the IT guy to configure the server to have a backup at least once a week. The client was already under the assumption that this was being done and was shocked when I told her that there were no updates. Hopefully that conversation wasn’t too bad for the IT guy!
Lessons learned from this are definitely check all of your SharePoint environments, especially ones you didn’t set up in the first place, and make sure there is a backup being performed. At minimum you should have a batch file set to run weekly. Even better would be a full database backup using a SQL Server maintenance plan if your environment is configured to use the full version of SQL Server. Also a full server backup will catch the file system so you will have a backup of the 12 hive. These are standard practices in large corporations, but in consulting you sometimes end up working with small clients that don’t have an IT staff so you need to take responsibility and make sure all of this is done. It will make your life easier just in case something does happen!

No tags

Thanks to everyone that came out to SharePoint Saturday. Thanks to Eric Shupps for getting everything organized and getting some great speakers out to talk about SharePoint!

I appreciate all those that came to listen to my session on using jQuery to make the end user’s experience better in SharePoint. There were a few technical issues, but I think everyone was excited to hear about what jQuery can do for them.
There are plenty of resources out there for everyone to get quick pieces of code to use in their implementation, but don’t think that it is too complicated for you to start writing your own! On the Manning website there is code that can be downloaded for you to test out your jQuery skills against a sample DOM. You should also pick up the jQuery in Action book to go with the sample code so you can follow along and get the best learning experience.
The slide decks should be out on the SharePoint Saturday website or you can use this direct link.
Over the next few weeks I’ll put out some sample jQuery that you can put into your dev sites to play with.

No tags

This was a fun adventure that ended with me solving the problem and Microsoft support not responding.

Of all the ways to submit a form to a SharePoint library only one of them works according to MS. The simple way of using a Data Connection with stored credentials was not allowed as MS considered it a security risk. Doing a direct submit to the library is out too!
What’s the only way?
Create your own web service and submit your form to it so it can use elevated privileges to save to the SharePoint library. That and the combination of either one of two things. Not precisely sure which one did it since I did both just to cover all bases.
Since I got it to work in my dev environment that was running on a VM with SP2 installed my boss determined, with pressure from our client, that we needed to install SP2 on the production server. A little premature since it hasn’t been out that long and there was a least one major thing broken with the update. Yes the fix was simple, but it was a pretty big bug. See my other post on that one.
The other piece that was mentioned by other bloggers was to make a change to the registry that requires a restart.
In the end, one of the two fixed the issue and now my forms are being submitted successfully!

No tags

Tonight I’m performing my first SP2 install attempt on a production server. All service packs are downloaded and the installation process begins.

Starting the WSS SP2 update now…
10 minutes later: WSS SP2 installed and configured. Shane Young skipped the configuration during his update, so we’ll see if I have a different outcome. You check out his steps here.
Starting the MOSS SP2 update now…
25 minutes later: MOSS SP2 installed and configured. Testing out the sites to see if anything broke.
Looks like no issues to report on the admin site. Public site looks good too! Even the custom templates that were installed seem to be working on the Intranet site.
Install went extremely well considering all of the parts that could have broken. Tomorrow bring testing of the new browser support. We were experiencing issues with IE8 on our public site. I’m going to update the master pages tomorrow to see if SP2 fixed our issues.

No tags

Jun/09

22

SharePoint Saturday Dallas

Check it out! SharePoint Saturday is hitting Dallas on July 25th. Come out and listen to different speakers talk about what’s going on in SharePoint these days.

Here is the official site

No tags

Older posts >>

Theme Design by devolux.nh2.me