Archive

Author Archive

My Blog Has Moved

March 22nd, 2011 2 comments

Ok…so I’m still in the process of tweaks here and there, but I will no longer be posting any new content here. My new blog is: http://www.sharepointben.com/blog. I’ve finally decided to give it a little bit more official SharePoint name as well as host it on SharePoint 2010 thanks to FPWeb.net.

I’ve also set up feedburner with my new blog to make the RSS feed a little nicer. That URL is: http://feeds.feedburner.com/SPBenThereDoneThat.

All my content as well as any comments have also been moved over to the new site compliments of Metalogix so nothing will be lost in the move. I think that’s all for now, I may re-provision this site, sometime int he future, to be focused more on my personal life outside of SharePoint. We’ll see. So, head on over to the new site and check out my latest post on SharePoint 2010 and Document IDs.

Thanks!

Ben Stegink

Categories: SharePoint Tags:

SharePoint Timer Job – Error during encryption or decryption

January 13th, 2011 No comments

The other day I went to deploy a solution to our SharePoint farm and got the following error in the Solution Management in Central Administration.  Some important background info is that this solution first created a Web Application.

image

We have a 4 server farm and the solution wasn’t deploying to any of the servers.  Looking at the event log, we had several different errors all containing the text (the event ID for all of them was 6398):

Error during encryption or decryption. System error code 997.
Error during encryption or decryption. System error code 0.
Error during encryption or decryption. System error code 122.

All of these were based on a time job provisioning something, either the web application or the solution, or come to find out, some of our search services were having errors starting.  The web application for this solution was being created on one of our servers, but failing on the other three (this was what was actually holding up the solution from being deployed).

After doing some searching everyone gave two options:

1. Recreate your SharePoint Configuration database…yeah right, this is going to be our VERY LAST attempt.

2. Run stsadm –o updatefarmcredentials (if you want to stop reading here, run this command first and it should fix the errors listed above…ONLY if this doesn’t work consider recreating your SharePoint Configuration database)

Neither one of these really seemed to make sense, we created all 4 servers in the farm from scratch, install SharePoint on all of them at the same time, created about 8 web applications that had all provisioned fine already, and never made any changes to user credentials (as some posts suggested).  Since the web application was being created fine on Server 1, we started looking at servers 2-4 as to what happened that would block a web application from being provisioned.  We couldn’t find anything.

Finally, we looked at Server 1.  This server had a timer job running with a different credentials than Servers 2 – 4.  Come to find out, when the install had been done, for some reason SharePoint was installed on Server 1 with one set of credentials and on Servers 2 – 4 with a complete different set of credentials.  After realizing this, we conceded to the fact that yes, user credentials are probably all messed up in our SharePoint Configuration database.  We ran the stsadm –o updatefarmcredentials command this morning and all of a sudden the web application could be created, search services started and solutions were able to be deployed.

 

I’m still baffled as to how our original 8 web applications were created and how solutions were properly deployed previously, but hey, at least everything is fixed now and set up properly.

Check User Permissions on a SharePoint Site using C#

December 8th, 2010 2 comments

Another SharePoint 2007 development post from the non developer, so feel free to offer any suggestions and comments around my code as I’m still learning.  I know, I should be doing this on SharePoint 2010.  Trust me, I’m trying to get us there.

Anyways, a brief background on what I’m trying to accomplish. I’m working on a navigation solution for our current intranet that queries a list of SharePoint sites that have been requested, approved and created via our site request process.  The query results are then filter based on if the current user has access to the site.  This list contains variety of sites, site collections and sub-sites that are spread out across 3 different web applications.  The solution then displays those sites in a web part for users to have “quick access” to their collaboration sites.  It’s basically a way to provide navigation (contained in a web part) across site collections and web applications automatically off a list of sites.

In order to check for access I decided to use the DoesUserHavePermissions() function.  However, after writing this function:

private bool UserAccessToSite(String user, SPWeb testWeb, SPSite testSite){
    bool access = false;
    try{
        access = testWeb.DoesUserHavePermissions(user, SPBasePermissions.EmptyMask);
        return access;
    }
    catch{
        access = false;
        return access;
    }
}

I was getting the following error stating that the “List does not exist”

image

I tried a variety of different approaches just to get it to return false if the user has Access Denied to the site.  After a bunch of different tries and some searching online, I ran across this post by Krichie that solved the problem for me.

Right before checking DoesUserHavePermissions I had to add the line SPSite.CatchAccessDeneidExceptoin=false;

So, the final code that is now working is:

private bool UserAccessToSite(String user, SPWeb testWeb, SPSite testSite){
    bool access = false;
    try{
        testSite.CatchAccessDeniedException = false;
        access = testWeb.DoesUserHavePermissions(user, SPBasePermissions.EmptyMask);
        return access;
    }
    catch{
        access = false;
        return access;
    }
}

My web part is now configured in order to query the list and only return a link to a SharePoint site if the user currently logged into SharePoint has access to that site.  I still have some work to do on the web part and the rest of the solution, so as I continue this adventure I’ll try to post any other updates.  Who knows, maybe once I finish it I’ll even post the whole solution up here.

Again, feel free to correct my code or offer other suggestions as I continue to delve into the SharePoint development space.

SharePoint 2010 October CUs reposted

December 2nd, 2010 No comments

Just a quick update.  Yesterday Microsoft reposted the October 2010 Cumulative Updates for SharePoint 2010.  For all the information, head on over to the Microsoft SharePoint Team Blog post about the reposting.

Free SharePoint Foundation 2010 Site!

November 18th, 2010 No comments

The other day I saw a tweet about a free SharePoint Foundation 2010 site, so, being the SharePoint guy I am I decided to look into it.

Sure enough, the people over at PortalFront Hosting are giving away free SharePoint Foundation 2010 sites to SharePoint bloggers here.  The process is really simple, I registered and created a site and filled out the form to request the free site.  A couple of days later I received the email with the information about my free SharePoint Foundation 2010 site.

I’m currently considering moving my blog over to that site, but would need to do some customization work first.  If nothing else I’ll keep my blog here and link to that site to show demos and for examples.

So, if you’re looking to play around with SharePoint Foundation 2010 or just looking to host a blog on SharePoint Foundation2010 but don’t have the money to pay for a lot of the hosting options for SharePoint I highly encourage you to check them out.

Of, if you’re looking to host any other SharePoint sites, they have a variety of different SharePoint hosting plans available at different price points.

Powered by

SharePoint Hosting

Complete
SHAREPOINT HOSTING
Solutions

Categories: SharePoint Tags:

SharePoint Server 2010 October CU “recalled”

November 8th, 2010 No comments

I’m a little late in getting this out as I was out of town over the weekend, but just in case you missed it, the October Cumulative Updated for SharePoint Server 2010 has been taken down due to a recently discovered critical issues.  For more details see the posts on the Microsoft SharePoint Team Blog.

Initial Announcement – http://blogs.msdn.com/b/sharepoint/archive/2010/11/05/critical-information-about-the-sharepoint-server-2010-october-cumulative-update.aspx

Details and Workaround – http://blogs.msdn.com/b/sharepoint/archive/2010/11/06/details-and-workaround.aspx

Testing Large Lists in SharePoint

October 26th, 2010 1 comment

Today I needed to do some testing around large lists, views, queries, etc as I’m working with a proposed feature.  I realize there is a lot of documentation around this in terms of keeping a view under 2000 items, or not having more than 2000 items in any folder.

These are recommendations that have been backed up with data, however, sometimes nothing beats just testing everything out for yourself.  How is my farm or this feature going to react when a list gets too large?

I found the SharePoint 2007 Test Data Population Tool that enables you to quickly load up your farm with test data.

MOSS – http://sptdatapop.codeplex.com/releases/view/1214

WSS – http://sptdatapop.codeplex.com/releases/view/1141

There are certain features that are available in WSS that aren’t in the MOSS version, so even if you have MOSS, you’ll probably want both.  This tool made in very easy for me to fill up a test list with as many items as I wanted with 3 short lines in an XML file and a simple command point to the XML file and the URL to the site containing the list.

There is a ton of additional functionality in these tools also as far as creating sites, site collections, load testing, etc. that I haven’t even begun to explore.  So, if you want to do some testing around what your SharePoint farm can handle, I would recommend adding this to your tool belt.  Just make sure you don’t run this against a production farm if you are testing the limits Smile.

Upgrade SharePoint 2010 Standard to Enterprise

October 18th, 2010 2 comments

I have a Stand Alone, SharePoint 2010 Standard Server and needed to do some testing on Enterprise.  So, I made a copy of the Standard Server, did some renaming of my VM and booted it up to convert it to an Enterprise license.  However, when I followed the the steps to update to Enterprise (http://technet.microsoft.com/en-us/library/cc261946.aspx) I was receiving an error.

I checked the Windows Event Application log and was receiving and error about not having administrative permissions to launch the configuration wizard.  The first step I took was to add my farm administrator account to the Domain Admin, still no go.  So I added the farm administrator to the Enterprise Admin group…still nothing.

My next step?  Disable UAC.  I’ve had some problems with UAC and SharePoint servers before, but like to keep from disabling if I can.  My next issue was that my stand-alone server is a domain controller, therefore, not having the UAC settings in the control panel.  So I resorted to command line prompt.  To disable the UAC via the command line run this command:

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

When I took the nessesary steps to upgrade to Enterprise after this is worked like a charm.  Unfortunately, I’m not sure if you need to have you farm admin in either of the administrator groups in AD as I forgot to pull them out after turning of the UAC, but I know for sure the UAC plays a part.

Once the upgrade to Enterprise has been completed you can turn the UAC back on by running:

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

If anyone gets the chance to run this with the UAC disabled and the SharePoint farm administrator account removed from the Administrator groups, leave a comment and let me know how it goes.

SharePoint 2007 Navigation, Documents, Lists and Anonymous Access

October 1st, 2010 No comments

I had this problem today on one of our sites that has anonymous access enabled.  We wanted to link to some PDF files in our quick launch navigation, so, naturally, we logged into the site and manually added the links.

However, when we tested the site with anonymous access the links weren’t there! So, next step, check the document library.  It was inheriting permissions, and I could even manually type in the URL to the document library and the PDFs using anonymous access and view everything just fine.

So, time to start digging.  Fortunately I found a thread on a discussion board that pointed me here – http://support.microsoft.com/kb/927082/en-us?spid=11373&sid=200.  Apparently when you turn on Anonymous access, Microsoft doesn’t think you could really want everything to be anonymous access.  Anywho…I figured it was worth a shot, so I logged into the server, disabled the feature running the command in the KB article linked above, turned anonymous access off and back on and what do you know.  It worked!!!

So, if you are having any trouble with certain lists, documents, navigation, etc.  Give this solution a shot.  As of yet I’m not aware of negative impacts to disabling this feature, but if I find any I’ll definitely update this post.

Upcoming Events Web Part

September 28th, 2010 No comments

I’ve actually done it, a SharePoint Administrator writing a web part.  Granted this web part is in it’s earliest stages, but it performs the task I needed it to.

So, what does it do? It’s a very simple SharePoint 2007 web part (So far I have only tested it on MOSS 2007 Standard Edition) that takes a URL (must be absolute at this point in time) and the name of a SharePoint Calendar list and displays the events on the calendar for the given week.  It can be placed on any page or site within your web application and query a calendar on any other site.

Also, the key issue that got me writing this web part is that is correctly handles recurring appointments on your SharePoint calendar.  If you have recurring appointments, this web part will show the correct start and end time for ONLY the recurring event in the current week rather than the end date for the last recurring appointment.  Here is a screen shot displaying the web part returning a variety of different events scheduled in the same week.

image

Granted, it’s nothing fancy, but for me it was a big deal coming from a SharePoint Administrator background.  There are also lots of bugs to it and errors that aren’t properly handled.  But, it’s a start.

If you want to play with the web part, you can download the solution file below.  Just remember, it’s free, it’s my first real web part and there are definitely several bugs.  So, if you choose to try it out:

1.  Don’t complain about it not working the way you want or about bugs…remember it’s FREE. 

2.  If you do find a bug or have suggestions to improve it, I welcome the comments and suggests and we’ll see what I can do as time allows.

3.  There is no warranty, guarantee, etc, etc…pretty much, I’m providing it free as is.  If you choose to install it in your farm that is your choice and your responsibility.  By downloading this web part you are agreeing not to hold me responsible for any negative effect or impact it has on your SharePoint environment.  Again, if it does something weird, feel free to let me know and I’ll do my best to help you, but there are no guarantees.

If you still choose to try the web part you can download it here.  To install and use the web part:

1.  Download the .wsp file

2.  Add the solution to your farm

3.  Deploy the solution

4.  Activate the Site Collection Feature “Upcoming Events Web Part”

5.  Add the web part to your page

6.  Open the Web Part Properties and in the respective boxes enter an Absolute URL for the page where your Calendar List is located as well as the Calendar Name.

7.  Click OK.