Posts

Breaking Permissions and Web Part Access

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 Gall...

Backup and Restore with sitelock option

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 argume...

Thumbnail View of Slides

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>

Lockdown Your Web Site For Anonymous Users

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...

Corrupt WSS 3 Content Database Recovery

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 thro...

SharePoint Saturday Follow-up

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 ...

Submitting InfoPath Forms to a SharePoint Library

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...