Sunday, December 14, 2008

Load balancing the certificates on a WSS may cause errors...

Which we found out when we tried to use load balancing for the https and certification. What we want to do is to let the load balancer redirect to any of the two frontend webservers, and not create the certificates directly onto the IIS sites (as usual). So we entered the https URL in the AAM, but we did not create a cert or activate the 443 port on the web application. But when we tried to access the https URL in our browser, we got two login prompts - the first against the https and then a login for the http URL! We changed every setting, tried different configurations, but still we could see in the logfiles that there was a redirect from incoming https to http! WTF? We even created a certificate on one of the IIS web apps just to be sure that the site was working. And that was no problem at all. Of course. No errors in configuration there :) Got a mail from my collegue with a link that describes this error on MS site:
http://technet.microsoft.com/en-us/library/cc288609.aspx#section6

This is a part of the error description that MS gives on the link above:

"Note: Installing the Infrastructure Update for Windows SharePoint Services 3.0 in a Windows SharePoint Services 3.0 farm that uses alternate access mappings with a reverse proxy or a network load balancer, such as in an extranet deployment, may cause some public URLs to become unresponsive. Microsoft is aware of this issue and is developing a solution. Before installing the Infrastructure Update for Windows SharePoint Services 3.0, customers who use this configuration should use a test environment to verify that public URLs remain accessible after the update is installed. "

No wonder. The funny thing about this is that when you have installed the infrastructure update, - there is no return! You cannot remove it. (And you do want all updates when you install the server for sure.) So I think it is a bit late for "verify that public URLs remain accessible after the update is installed" once you've installed the update. Even on a test server...

Wednesday, December 10, 2008

In one week..... yeah yeah

Then I am off to - hopefully - a sunny weather with lots of SPA treatments! Jealous? Thought so... Well it is not the most exotic place to travel to, but wtf it's a nice vacation and I just wanna sleep, eat, drink and party for a week. And forget about christmas! But, since we're going to Playa Del Ingles (I know...), then you might expect people dancing around a xmas tree in the pool, right? I'll bet they have a swedish xmas "julbord" as well... "There is no escape, and that's for sure"!! The picture is from our hotel, looks nice yeah?


Tuesday, December 9, 2008

RAD Editor Lite

This is a really cool freeware that I can recommend after having installing this on a WSS site. It will override the crappy RTF editor that you have in lists and any RTF field in SharePoint. Just click on the RAD Editor Lite and download it for free!
http://www.telerik.com/products/aspnet-ajax/sharepoint.aspx

In the right business.....

According to an article in Aftonbladet today anyway where they say that IT-specialists are one of the top ten future professions ... :) Yup, I think they're right! No sign of financial crises in my line of work. Yet. But who knows... better safe than sorry, Svenska Spel that's the way to go :)

Monday, December 8, 2008

Menu customization in WSS

I activated flyout menus on a WSS site today, and everything works fine - except ONE thing.. Why is it always like that with Sharepoint that when you win some - you loose some?? I have branded the menu and before I activated flyouts, the selected menu (that is, the ACTIVE menu) was showing the right background image (a darker image). But after - and this is interesting - the selected menu does not display the "over" image but instead it is the "Home" menu that looks like the selected one. I wrote my own class in my css file to make it override but that did not effect the style so I probably have to explore the sp asp menu object a bit more...

Sunday, December 7, 2008

Top navigation not loading in Safari

I got error reports that the Safari browser did not load the dropdown menus in SP top navigation menu. I use dropdown menus on a site that I have built on MOSS for a public web site (PF). It looked like this in the Safari browser:




As you can see, there is a large white area where the dropdown menus was supposed to be loaded. So I rebuilt the site and tried it in Safari, and all worked well. Since that was a bit strange, I started making comparisons. Turns out (after a couple of hours digging....) that it had to do with the IIS! Quite unexpected... I had two headers, one that had the SP port and one that used port 80. BUT on the port 80 no default header was entered, like the full hostname, so when I entered the URL to the site on the port 80 - magic! The dropdown menu was loaded and the site worked again:


Wednesday, November 26, 2008

Now this makes me proud :)

Read this article (sorry it is only in Swedish) in IDG, the Sharepoint solution that Polfärskt talks about is delivered by yours truly.... Makes me happy :)

Tuesday, November 18, 2008

How fast can you brand a site :)

Tonight I built a site definition with a brand new design for a WSS site, easy. Took me about three hours to rebuilt it totally - both the default.aspx and the core.css. Of course I didn't edit the core.css, but called my file hardcore.css! I am used to work with MOSS and the master pages which is very straight forward and where you just enable publishing features on the site and get all the design elements by selecting your master page. With a site definition you have all the files in the 12 hive instead and put them all together in a definition package and activate them as a feature. Should be faster to load the design using site definition compared to loading a master page. What do you think??

Sunday, November 16, 2008

Erik & Mackan - they're back!

Jag älskar deras program! Dessutom gjorde Erik & Mackan (redaktionen typ) ett inlägg på min gamla blogg så jag måste ju bara promota "Snygga och smärta" :)

Wednesday, November 12, 2008

Deep dive into InfoPath

I am on new and thrilling territories right now, not really sure what I am doing but it's getting clearer and clearer... My mission is to place a button in an InfoPath form, with code behind that transforms the xml file into a PDF file and then inserts itself into a mail and of course - sends the mail :) Easy I thought, someone must have done that before. Googled it, found one article. And I have tried to follow it, but since I am not a developer there were some "issues" that needed to be understood first. Finally I have produced some code thanks to VS, VSTA, Notepad (i love Notepad btw :)), and some hacking into web.config and other shit. So now, wow, tried to execute my code and - nothing happens. Or, something happens, but it just seems to reload or tries to run the code but no PDF is created. So I think I have to make sure that the dll files are listed in web.config and that my itext-dll is registered. To be continued, the whole code will be published here if I ever make it :) I really miss my dev pro's at work now....

Wednesday, November 5, 2008

Use a domain account on MSSQLSERVER

We had some trouble running the full backup (both from CA and stsadm), we got error messages in CA that said "Error: Object SharePoint_Config failed in event OnBackup. For more information, see the error log located in the backup directory. SqlException: Cannot open backup device..." and in EventViewer it complained that we used a Bad username or password. Started to investigate that the app pools ran with the right userid = ok, services on the sharepoint server = ok, user account that initiated the backup = ok, network share had correct permissions and that it actually was a share = ok, the app pool account/service accounts/backup account had right permissions on the SQL server = ok, and then I thought everything was checked. But not. Turns out that the MSSQLSERVER service on the SQL server was running on a local account and that account tries to access the file share where you want your backup files and that share is of course not on the same machine so - access denied for that local account! It's all so clear when you find the error, isn't it? :) So, we changed the MSSQLSERVER to a domain account which has all rights to the network share and the databases, and now our backup is up and running!

Thursday, October 30, 2008

CQWP that displays date

I got a request from a customer that wanted the Content Query Web Part to display Created (or Modified, whatevah) date along with the title. Why isn't there a function for this already, and why why can't you select any column you want to display in the web part? I'm not so impressed by this web part as you can tell :) Well nevermind, moving on! I googled and found this nice description:

http://www.microsoft.com/belux/msdn/nl/community/columns/stevenvandecraen/contentquerywebpart.mspx
But instead of editing the itemstyle.xsl in Sharepoint Designer I copied the file and renamed it to itemstyle_lise.xsl and did all the customization in that file. Just to be sure that those customizations wont be lost in case of an upgrade or some other catastrophic scenario were all your work is lost! I am sure my Lise-file wont be overwritten :)

I added the CQWP to a page, exported it, opened it in Notepad and added some extra lines in it:


The above line points to my customized xsl stylesheet


The above line declares which default item style that should be displayed in the web part and I named my xsl template "Datum" inside the xsl file.

Saved the file as something else like "Datum.webpart" and imported it to the Sharepoint page, and now the webpart displayed my list with Date and Title.

Now you have your own customized web part and it wont effect the "default" web part:



Now to the deployment, and it's here where my coding skills sucks - or are non existent to be honest - and therefore I always look for the quick & dirty solution at first and then maybe... I'll ask my MVP collegue (yeah, he sits right next to me at the office - pure luxury) but that's not the first thing I'll do since I want to learn by doing. Trial and error, lovely. So my first thought is to upload it to the Web Part gallery under Site Actions, and put it in a group called "Lises web parts" or something.

The next, and real, step is to deploy it as a feature (I've been told by the dev pro's here) and I will give it a shot!

Monday, September 8, 2008

This is so so sad...

Read the chocking news that Patrick Tisseghem has passed away! I have met him a couple of times, and was really impressed by this guy. Extremely competent and funny with his belgian beer lists always ready :) He made coding look so easy! We in the sharepoint world have lost a great source of competence....

Tuesday, August 5, 2008

New updates may solve the BDC issue?

The new infrastructure update to MOSS fixes the issue I got in Event Viewer, regarding the BDC. It said that anonymous users are not allowed to connect. It seems like this new update fixes that:

"When users are authenticated anonymously, they cannot use a Business Data Catalog (BDC). This update enables the BDC to explicitly let anonymously authenticated users access the BDC"

Read more here, I will install this update ASAP.

Thursday, July 10, 2008

It's a dirty job but someone's gotta do it....

Got this error in the Backup history:

Object SSO failed in event OnBackup. For more information, see the error log located in the backup directory. SqlException: Could not locate entry in sysdatabases for database 'SSO'. No entry found with that name. Make sure that the name is entered correctly. BACKUP DATABASE is terminating abnormally.



Found out that in the Backup list there was a database called SSO that was listed for backup. But, it does not exist on the SQL server:




So, how do you edit the list of databases? I gave up searching cause I didn't find any good answers. I wanted to be able to edit the xml file that builds the list of databases to be backed up, (like the spsbackup.xml) but that is created when you run the backup...

I did a really quick and dirty solution to this: I ended up creating an empty database called SSO on my SQL server and now, the backup runs without any errors! Sometimes you just have to be a little dirty to get things done :)




Wednesday, July 2, 2008

BDC part 2

The struggle with the BDC (Business data catalog) continues and so far I am able to return a search result inside the Editor, but still not in Sharepoint. I think it has to do with the authentication. I use PassThrough, since WindowsCredentials needs SSO (which I have not enabled on the server). Here are some printscreens of what I have done this far. I have installed the Business Data Catalog Editor that comes with the SDK (read here). After the connection string is set, I am able to select the table that I want to get data from:


Uncheck the fields that you want to exclude from the query and press OK. Press OK again to confirm the connection. Now your entity is created:


Make sure that the “PassThrough” authentication is selected. Test the bdc file by opening the “Parameter” and “Instance” and select the instance. Rightclick and select “Execute”. Enter a value, for example a customer number and make sure that a value is returned:


Export the xml file. And then, import the xml file to Sharepoint (application definition file):




The import:



You will get an error message about the profile page, but nevermind. The message is “Could not create profile page for Entity NaB Solutions AB$Customer. The error is: Cannot create a new connection to closed Web Part g_c01d1f2b_0382_45a2_ad6e_07ce86936b3a". But, this is obviously not an error to care about. It is just a warning! Press OK to continue.


Now, go to your website and add the webpart for Business Data. Lets start with a list, enter a new column and select “Business data” as type. Enter the instance and select the fields you wish to display:


In my list, if I try to enter a character, it says that no exact match was found. If I click on the "more items" then it is empty as well:


And the “picker” where you can browse, is not selectable and there is no data in the column:




So I skip the list and select a webpart instead. The first web part is the Business Data Items. And that gives me the following error (Business data catalog object not found). I have tried them all Business Data List, Business Data Item etc but noone gives me any data:



None of the webparts displays any data. So I figured that something was changed in the xml file while I imported it. So I exported the file from Sharepoint and imported it back into the Editor. Tried the Execute, it works.

This error turns up in Event Viewer but I don't know how to correct it - yet:

Friday, June 27, 2008

A new fresh attempt with the BDC

I have tried this before, but with no result, to actually get data from Dynamics NAV straight into Sharepoint using the BDC catalog. It seemed so easy, just create the ADF file and import it in Central Administration and youre ready to read from your business system. Not quite.. So today I did a new attempt using the BDC application from Microsoft (downloaded it here). I have tried the BDC Metaman before, but today I used this app which comes with the SDK:



Quite easy to install and setup and even enter the connection string:

"Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True;"

I added the table I wanted data from and exported the xml file and imported it to Sharepoint. I got an error about the profile page:

Could not create profile page for Entity NaB Solutions AB$Contact. The error is: Cannot create a new connection to closed Web Part "g_f9c81dbd_bdf8_4935_a3f3_6558836696df".

Went into my Sharepoint site and created a column that is of type Business Data and it was empty. Access? No, I'm the admin. I probably need to configure some more, and look into the error I got.

To be continued...

Wednesday, June 25, 2008

Display updated items

The Content Query Web Part is really nice but leaves some wanted functions like:

* Display updated items for a specific time period
* Be able to display items from several lists and libraries (why not all?)

* It would be nice if you could filter your latest updates so that it does not show an item from the year 2007 just because that is the latest updated item. You should be able to set a filter that tells the webpart to display only items that are [Modified]+7 or something similar. As it is now, you have to create such a field in your list and display that certain field (I did this, look further down in this post).

* I would like to pick any field from my lists and display them and sort them in the webpart. Only fields that are created as Site Column are in the list now.

* You may group your latest updates and that is nice, I usually group them after Site. BUT, if you only want to show the latest 10-15 updated items - and you have like 5 updated items on one site - then it only shows 15 rows and that mean that I can't see the other sites updates because of the row limit. It would have been nice to display the ONE latest update from all the sites.

One solution I have used to display only the latest weeks updates is to do this:

Create a new column. Important: you must create it as a Site Column! Or else you will not find it in the Content Query Web Part!
Enter a name that tells the user that this is a "system" field with a name like "ShowUntil" and select "Date and Time" as the type of column.

Date and Time Format is set to "Date Only".

Then set the default value to a calculated value. Add "=Today + 7".

Clear the Add to default view check box.

Save the new column.

Add your new column to the document library or list you want to display updates from.

Now in your Content Query Web Part, select the column you created and set the filter to display it if it's "Greater than or Equal to" [Today] to your column:



Now when the list is updated on a site, it will be displayed in your web part for seven days from the created date.

Show the weather

If you want a webpart that displays the weather, then this is a nice web part. I downloaded it from Bamboo solutions, on this site: store.bamboosolutions.com. And it is very easy to setup.
Here is an example:

Monday, June 16, 2008

The publishing feature

I use the built in CMS system a lot in Sharepoint, both for external and internal websites. It's easier to build templates for the user so that they are able to create news and stuff fast. There are some irritating stuff regarding that function though. Attach a file or insert a picture are really a disaster, not for me but for the user! I mean, how many steps are there for this? I have tried to insert an upload-button but that did not work so I gave up.

Let's say that your user actually did manage to find the hyperlink button and managed to upload a file from the hard drive then you must first close the window that displays that the file is uploaded (why??? just add a script that closes that window... or?? totally confusing for the user) then you MAY find yourself be in the wrong library.. Yes. Why isn't there a feature or function that returns the user to the correct library - the one that belongs to the site, and NOT the latest you opened. And what else could happen? You upload the file to a library where the readers dont have access. Omg. Really thought through function. But the most annoying thing is the window where you see your uploaded files, they are sorted... ascending!! So every f*ing time I attach a file and I have looots of files in those libraries I have to set the filter to descending or browse to the end of the library to find my files (fastest is to filter in descending, but how tiring isnt this?). I have really looked for a solution that at least sorts my uploaded files in descending order so that my uploaded file is the first file in the list.

These are things that make you so tired of Sharepoint, it could be such a great application but sometimes it sucks.




Anyone who knows a "solution" to this?

Friday, May 23, 2008

Shared calendar

Hmm saw something interesting today, regarding shared calendars. Everyone wants to publish a shared version on the intranet but I have not found any web app for this. Maybe this could be something to use? Anyone who has tried this one?
http://www.amrein.com/apps/page.asp?Q=392

Sunday, May 18, 2008

Zlatan is king

Det kan man kalla inhopp värt namnet! Vilken grym fotbollsspelare han är!!


Tack släkten!!

Igår var släkten här och firade, vi hade supertrevligt och dom sista nattsuddarna åkte taxi hem runt midnatt. Tack för alla fina lyxiga presenter, mycket mycket uppskattade!! Kvällen gick så jäkla fort, och mitt i allt kom det ner tre coola Falun grabbar som skulle hämta min lilla Toya... så nu är bilen såld och saknad :=). Om växeln jag fick har täckning så sålde jag den för 140.000 - annars så har jag fått 10... för det fick jag kontant hehe. Men jag känner mig lugn, det var supertrevliga killar som har kört 120 mil för att hämta en bil genom ett snöigt Dalarna ner till ett soligt Småland. Hoppas allt gick bra på hemresan, den var nog inte klar förrän 4 imorse!
Tillbaka till kebabtallriken och soffan, kram!!

Friday, May 16, 2008

Tack tjejerna!!

Var bara tvungen att klämma in följande meddelande trots att jag inte bloggar längre :)
Nu har presentkortet från Skansen kommit, tack snälla ni!! Jag ser verkligen fram emot vårt besök där! Stora kramar till er :)

Friday, May 9, 2008

Character settings in mail from InfoPath

I don't really know how to explain this error correctly but what happens is that when you receive a mail via InfoPath Forms Services it is not presented with any swedish characters "ÅÄÖ" but instead it uses like wing dings or something. It looked like this:


But after changing the setting "Web application outgoing email settings" in Central Administration (on "Application management") it displays correctly. Every web app was set to Unicode so I change it to 1252 Western European Windows, and voila - you can now read the mail without having to change the coding:

Thank you Scott Heim at Microsoft!

Wednesday, May 7, 2008

Sharepoint Services Timer hangs

This is really irritating. The service Windows Sharepoint Services Timer regularly hangs on the server, which leads to that no alerts are sent out. And you cannot just restart the service, that wont help, you must stop and start the service. Weird. Yet another issue to add to the list...

Friday, May 2, 2008

Error 5760 in Event Viewer regarding InfoPath

Microsoft is working on my case to solve the issue I have with attachments in InfoPath. Today I found this error registered in Event Viewer on the MOSS server:

Event Type: ErrorEvent Source: Office SharePoint ServerEvent
Category: Forms Services Runtime
Event ID: 5760
Date: 2008-05-02
Time: 08:57:11
User: N/A
Computer: SRVXXX
Description:InfoPath Forms Services has detected a mismatch between the user's data in the browser and on the server. This may indicate the SESSION_STATE_PASCAL_CASED is not configured properly on a multiple front end farm or that a malicious user is trying to tamper with client data. (User: domain\xx, Form Name: Testform, IP: , Request: https://xxx/_layouts/FormServer.aspx?XsnLocation=https://xxx/Testform/Forms/template.xsn&SaveLocation=https://xxx.se/Testform&Source=https://xxx.se/Testform/Forms/AllItems.aspx&DefaultItemOpen=1, Form ID: urn:schemas-microsoft-com:office:infopath:Testform:-myXSD-2008-04-29T14-39-23)
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Tuesday, April 15, 2008

Cannot open Infopath attachments in Outlook 2007

I have built an InfoPath form and web enabled it. Users fill in the form in Internet Explorer and attach a file to it. When they press the “Save” button, a mail is sent to some receivers in Outlook. When they try to open the form, they get the following error:


Enlarged error:

I will try to translate the above error message here: “Infopath cannot open the following file c:\documents….” “The file is not a valid xml file”. “The form contains XML that cannot be parsed”. An invalid character was found in the content” and then it complains on the formatting of my attachment field which in this case is “fält2”.
After I press OK on the error message the form opens up as a normal mail, and not in InfoPath as expected:


As you can see, the mail attachment has been converted to an empty textbox!
The attachment is removed, because if I try to open the attached form.xml file I get the same error in InfoPath.
This happens to ALL types of files, except .txt files. If the user attach a .txt file and the form is opened in Outlook, it opens correctly and you can see that attached file:
I have this case at Microsoft right now, and will tell you the solution to this as soon as I get it.

Tuesday, April 8, 2008

Victory over SBS, YES!

Yes, today I have been fighting with a customers small business server - but I won!! What I did? The most dreaded - uninstalled WSS 2 on a SBS server and installed a fresh WSS 3 version. Everything went perfect until I wanted to give the new portal a hostname. Did not work. Every hostname or IP just redirected to the ugly Companyweb (even if I updated AAM in CA). Crazy. I ended up adding a new IP-address to the server and dedicate the new portal to that address instead. Removed all "old" shit in the IIS like old application STS-pools and stuff. In this order: added a new IP, added a new record in DNS pointing to that IP, changed the IIS web site to the new IP, added a new AAM-record in Central Administration. IISreset. Worked like a charm :) You just have to do things in the correct order, or everything will freak out. Now I just need a SSL cert and all is done. And me too...

Monday, April 7, 2008

Notepad ++

Get it today! A really really helpful extension of Notepad. Things you have been longing for :) The simplicity of Notepad but extended with functions like comparison (love it), intellisense (just select the code language you are using and it will color the tags...), line number etc etc. Lovely!! Get it here:
http://sourceforge.net/projects/notepad-plus/

Happy coding :)

Change the "Sign in" text

If you want to change the "Sign in" link text on a Sharepoint page, then do this:

Open the beloved folder C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES

Open "Welcome.ascx" and go to the end of the file
Change the tag:

SharePoint:ApplicationPageLink runat="server" id="ExplicitLogin"
ApplicationPageFileName="Authenticate.aspx" AppendCurrentPageUrl=true
Text="<%$Resources:wss,login_pagetitle%>" style="display:none" Visible="false" />

to this:

SharePoint:ApplicationPageLink runat="server" id="ExplicitLogin"
ApplicationPageFileName="Authenticate.aspx" AppendCurrentPageUrl=true
Text="Your text here" style="display:none" Visible="false" />

No defined path - MySite

If you get an error message saying that MySite cannot be created due to a missing tag in the URL or error in the defined managed path, then you have to do this:

Open Central Administration
Application Management
Define managed paths
Add the path, like "personnel"

Stylesheets that are used in MOSS

I do a lot of CSS changes to my sites, I find that easier and quicker than to rebuild themes or site definitions and stuff.

MOSS 2007 uses the following css files:

controls.css
HtmlEditorCustomStyles.css
HtmlEditorTableFormats.css
portal.css
core.css

When you create a WSS site, the following CSS files are used:

portal.css
core.css

MySite

portal.css
core.css

Anonymous access with Publishing portal

When you activate anonymous access on a site and you would like your anonymous users to be able to publish an item to a list, then you cannot use the template "Publishing portal". Why? Don't know! You must use the template "Team Site" for this to work! I noticed this when I had activated anonymous access but never got rid of the login-prompt! So.. I created a new site and used the template "TeamSite" and enabled anonymous access on it, then voila - an anonymous user was able to post an item to my list without being prompted with the login! Strange....

Remove the "Powered by..." in InfoPath forms

In this folder (the one and only.. right?) "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\INC" is a file that is called "ifsmain.css". This stylesheet file controls how a web form built by InfoPath is displayed. If you want to remove the logo "powered by InfoPath services" that is displayed in the bottom of every web form then write "display:none" or color the text tag to the same as your background color.

Create a new search scope

This is very useful. Say you have several web sites and you don't want to display the same search results on every web site - only the results relevant to the current site! Do this:

Open Central Administration
Open your SSP
Click on "Search settings" and then "Content sources".
There is a list of current content sources, there might just be only one:


Anyway, click "New content source"
Fill in the following fields like this
"Name of the Content Source" = your web site name
"Content Source Type"
"Start Addresses or Applications" (if you choose the Business Data option)
" Crawl Settings and Schedules"
I always enter the name of my content source to the name of the site, it makes it easy to know where it is applied :)
The start address is the URL of my site, for example http://mysite.se/



If the content source is a public site then you may not have to index the site so often. I usually run the Incremental Crawl each hour or so instead.
Now save your settings and perform a Full Crawl on your new Content Source.
When that is done, go back to "Search Settings" and select "View Scopes":



This page shows what scopes this SSP handles. Add a new scope and call it the same name as your content source, ie "mysite". Now, you have to add some rules to your scope:

Click on "Add rules" and add the following:


I checked the "Content Source" so that I could select my content source "mysite". Then I checked "Include" because I want all info on this site to be returned in the search results. Now you have to update your new scope.

Click on "Start update now" from the Search settings page.
When the update is ready, you have to associate the scope to your site. Go to Site Settings on your site, click on "Search Scopes" under "Site Collection Administration". Click on the "Search Dropdown" link:

Now all available scopes are shown including our new scope:

Select your new scope – wow! Uncheck the other scopes, we do not want them on this site.
Your list should now look like this:



Now try your site search. When I did this, other search results STILL showed up. To change this, click on "Edit page" and select "Modify shared webpart" on your search result page. There is a field called "Scope" and even if there is no list to select your scope from, you can simply write in the name of your scope, like "mysite".
Now when you perform a new search, only results from your site will be displayed!

Event id 7888 in Eventviewer

A while ago I got a lot of error messages in Event Viewer on our MOSS server. I found the following solution:

run stsadm -o sync -DeleteOldDatabases 0

and the message disappears.
What it does is enter the table "sitesynch" on the SQL server and deletes connections to any old Sharepoint config database that you may have on your server.

The entire message:

A runtime exception was detected. Details follow.
Message: A duplicate site ID 3b2fa192-1efb-4715-970f-2e550122faf0(
https://xxxx) was found. This might be caused by restoring a content database from one server farm into a different server farm without first removing the original database and then running stsadm -o preparetomove. If this is the cause, the stsadm -o preparetomove command can be used with the -OldContentDB command line option to resolve this issue.
Techinal Details:
Microsoft.Office.Server.UserProfiles.ProfileSynchronizationDuplicateSiteIDException: A duplicate site ID 3b2fa192-1efb-4715-970f-2e550122faf0(
https://xxx) was found. This might be caused by restoring a content database from one server farm into a different server farm without first removing the original database and then running stsadm -o preparetomove. If this is the cause, the stsadm -o preparetomove command can be used with the -OldContentDB command line option to resolve this issue.
at Microsoft.Office.Server.UserProfiles.ContentDBSynchronizer.RegisterSitesForSynch(Guid[] rgGuid, Int32 nGuids, Object dummy)
at Microsoft.Office.Server.UserProfiles.SynchCollection`2.FlushAdds()
at Microsoft.Office.Server.UserProfiles.SynchCollection`2.Add(T objAdd)
at Microsoft.Office.Server.UserProfiles.ContentDBSynchronizer.AddRemoveSites(String strFirstChangeToken, SPChangeToken lastChangeToken)
at Microsoft.Office.Server.UserProfiles.ContentDBSynchronizer.SynchContentDB()
at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)

Install IFilter on MOSS

How to install the PDF iFilter so that pdf files are searchable (and given an icon too)

Download the latest Adobe PDF IFilter from http://www.adobe.com/support/downloads/detail.jsp?ftpID=2611
Stop the IIS service
Run the Adobe PDF IFilter Setup on your MOSS server
Copy the ICPDF.GIF file (search your server) to "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Images"
Open "C:\Program Files\Common Files\Microsoft Shared\Web server extensions\12\Template\Xml\DOCICON.XML"
Add the following to the .pdf type:

Run iisreset
Add the .pdf file type in the following list:
Open Central Administration, Shared Services Administration (SSP), Search Settings and select File Type
Add the new filetype pdf
Perform a fullcrawl of your content source

Useful STSADM commands

path to STSADM is
cd C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN

addcontentdb
stsadm -o addcontentdb -url URL [-databaseserver servername] –databasename databasename [-DatabaseUser username -DatabasePassword password] [-SiteWarning number] [-SiteMaximum number] [-SearchServer servername]

stsadm -o addcontentdb -url http://srv007:42464 -databasename Sharepoi1_SITE

stsadm.exe -o restore -url http://srv007:24003 -filename c:\backup\migrera-SRV005-ComSolut1_SITE.SPB

create a new site using a template in another language (in this case... surprise, Swedish!!)
stsadm.exe -o createweb -url http://server:port/sitename
-lcid 1053

export a site with version history and security remained
stsadm.exe -o export -url http://url/site -filename c:\backupsite\ds.bak -includeusersecurity -haltonfatalerror -versions 4

import a site with version history and security remained
stsadm.exe -o import -url http://url/site -filename c:\backupsite\ds.bak -includeusersecurity -haltonfatalerror -updateversions 1

Dropdown with URL in onchange

If you want to create a dropdown list with onchange event to dynamically go to selected URL then do this:

Use Sharepoint Designer
Insert Data View
Select Show Data
Select which field that should be displayed in the drop-down list
Insert Data
ViewData..
Style
Change layout to “Drop-down view style”
Click OK
Change to Code view in Designer
Put the following code before the /head> tag:

script language="JavaScript">

/script>

Then find the following in your code
select name="ID" size="1"12
Change that to
select name="ID" size="1" onchange="FP_jumpMenu(this,'window',false)">

Then find
option style="display:{$GroupStyle}"
Change to
option style="display:{$GroupStyle}" value=”{@FieldWithURL}”>
where FieldWithURL is the link that you want to go to
Save

Custom source in profile import

If you would like to be able to select which OU to import from in your Active Directory then select Custom Source in "Configure Profile Import" in the SSP settings. That will let you write your own custom source like the following example:

OU=NaBSolutions,OU=Hosting,DC=yourdomain, DC=se

The default setting is DC=yourdomain, DC=se so what you will do is to put the OU in front of the DC since it must be in a hierarchy.

Cool! So instead of importing 400 accounts from your AD you get the accounts that are relative to your site!

Create a content type for Word

I love content types in Sharepoint. I use them when I create new publishing pages, new templates, new columns and yeah that's it. So useful and powerful. Change in one place - update all others!

If you want to publish a Word template to a library you... that's right - create a new content type and associate your library with it. If you make any changes to your template, all libraries that use that template are.... updated!

Do this:
Site Actions, Site Settings, Modify All Site Settings
Click on ”Site content types” and ”Create”
Create a new with the name of your template, ie "Agreement"
Select ”Document Content Type” as Parent Type, and ”Document”
Put your content type in a new group with your company's name for example (this is so that you know which content types you have created and you will also find them easier)
Click OK (needed for any dummies :))
Click on ”Advanced settings” and select the template that should be associated with this content type by clicking on ”Upload new document template”
You don't have to mark it as readonly, but do select that it should be updated.
Then...
Open the document library where you want to use this new content type and do:
Click on ”Document library setttings” and select ”Advanced settings”
Activate ”Allow management of content types”
Click OK
On the middle of that page a new group is visible. Click on ”Add from existing site content types”
Select your group (your company name for example) and get your new content type
Done!
That was not so many steps.... :)
Now, when you look at your "New"-button in your library the new button "Agreement" should be visible! You can also metatag those templates with their own metatags, if you want to use several templates in the same library. Cool!

Content Deployment error

When I should activate Content Deployment on our Sharepoint server I got the following error message:
"Value does not fall within the expected range"
Oh I just love the error messages in Sharepoint, they are so informative :)

Ran the following commands instead:

Stsadm -o deactivatefeature -name deployment -url
Stsadm -o deactivatefeature -name migration -url
Stsadm -o activatefeature -name deployment -url
Stsadm -o activatefeature -name migration -url

Got the message
"Failed to find the XML file at location '12\Template\Features\migration\feature.
xml"
Opened the folder and saw that the folders "migration" and "deployment" were missing, but there was another called "Deployment Links" and "Migration Links". Copied those and renamed them to only "Deployment" and "Migration". Success! I was able to activate the new feature!

Deactivate the name.dll active x control

Websites built on SharePoint 2007 prompts you to install Microsoft's Name.dll ActiveX control on every page load of your SharePoint web site. Name.dll provides "presence" functionality, that is if you have Messenger it will display your online status. This is annoying, I think anyway :)



To remove the prompt on a site you have to do the following:

Go to the folder (the one and ONLY folder as a Sharepoint developer/administrator...)

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS"

If you don't want this to affect all of your websites (it is a really useful function on your intranet for example) so create a new folder on your server and copy the contents of the "LAYOUTS" folder to a new folder. Let's ensure SharePoint will have permission to access the files. Through Explorer, open the properties for your newly created folder and under the security tab add the "WSS_WPG" account (the default Read & Execute, List, and Read permissions are enough) and let's add the WSS_ADMIN_WPG account with full permissions (see image below). In the IIS Manager Console, open the properties for the "_layouts" virtual directory (under the web site you want to modify) and change the local path directory to your newly created folder. Test your Web Site and make sure everything is working.

The ActiveX feature is in a script file called INIT.JS located in the \LAYOUTS\1033 folder.

Go to the function called EnsureIMNControl()
Comment out the ActiveXObject line:
//IMNControlObj=new ActiveXObject("Name.NameCtrl.1");

After applying any updates or service packs to SharePoint you'll probably want to reverse this customization and perform these steps again after the update to ensure your web site is running on the latest code.
function EnsureIMNControl()
{
if (!bIMNControlInited)
{
if (browseris.ie5up && browseris.win32)
{
//@cc_on
//@if (@_jscript_version >=5)
//@ try
//@ {
//@ //IMNControlObj=new ActiveXObject("Name.NameCtrl.1");
//@ } catch(e)
//@ {
//@
//@ };
//@else
//@end
}
bIMNControlInited=true;
if (IMNControlObj)
{
IMNControlObj.OnStatusChange=IMNOnStatusChange;
}
}
return IMNControlObj;
}

Hide items from users

You can hide some functions from users on a page in Sharepoint by adding the "security trimming control" - it's really useful. For example, the "Site Actions"-button should be hidden from anonymous users.

Put the following tag around the Site Action control:

Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="BrowseDirectories">
[Site Actions content holder here]

/Sharepoint:SPSecurityTrimmedControl>

This permission string used the "BrowseDirectories" which is a very low level of permission. You can also use "AddItems" and so on, to allow users that has EditItems to see the SiteAction button but hide it from those who can Add items.

Missing features

When you install the language templates I have discovered that many functions are missing. The solution is to compare the 1033 folder with the 1053 and copy the files that are missing to your new language folder.

For example the search function on WSS pages:

I had to copy the file search.js into the 1053 (which is for Swedish) folder, and magic - it's visible!

Script that hides the statusbar in the web browser

script>

function hidestatus(){
window.status='Lises hemsida'
return true
}
if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
document.onmouseover=hidestatus
document.onmouseout=hidestatus
/script>

Error message in InfoPath after MUI installation of swedish lang files for Office

After the installation of the MUI swedish language files on our Sharepoint server, the following error occurs:
if you have any multiline fields in your InfoPath forms, like RTF fields, you are no longer able to mail those forms!
Really strange error, I know - but my world is full of strange errors.... I am so sick of it. The entire message reads:

Reference to undeclared entity 'nbsp'. Line 85, position 6559.
System.Xml.XmlException: Reference to undeclared entity 'nbsp'. Line 85, position 6559.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.HandleGeneralEntityReference(String name, Boolean isInAttributeValue, Boolean pushFakeEntityIfNullResolver, Int32 entityStartLinePos)
at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos)
at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
at System.Xml.XmlTextReaderImpl.FinishPartialValue()
at System.Xml.XmlTextReaderImpl.get_Value()
at Microsoft.Office.InfoPath.Server.Xml.SafeXmlReader.get_Value()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlDocument.Load(XmlReader reader)
at Microsoft.Office.InfoPath.Server.Xml.SafeXmlDocument.Load(XmlReader reader)
at Microsoft.Office.InfoPath.Server.Xml.SafeXmlDocument.LoadXml(String xml)
at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterEmail.GetViewHtml(XmlDocument input, String viewName, XsltContext xsltContext, Solution solution, Boolean cleanUpFormatting, String intro, String introSubmittedBy, ImageAttachmentHelper imageAttachmentHelper)
at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterEmail.Execute(XPathNavigator input, String to, String cc, String bcc, String subject, String intro, String attachmentFileName, String viewName, Boolean sendAsInfoMail, EmailAttachmentType emailAttachmentType, XsltContext xsltContext, String xsnUrl)
at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapterEmail.ExecuteInternal(XPathNavigator input)
at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapterEmail.Execute()
at Microsoft.Office.InfoPath.Server.SolutionLifetime.RuleAction.EvaluateExpression(Document document, XPathNavigator currentTarget)
at Microsoft.Office.InfoPath.Server.SolutionLifetime.RulesRuleSet.<>c__DisplayClass7.b__4()
at Microsoft.Office.InfoPath.Server.SolutionLifetime.RulesRuleSet.EvaluateExpression(Document document, XPathNavigator targetNavigator)
at Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonFormCode.<>c__DisplayClass2.b__0()
at Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonFormCode.Click(Document document, XPathNavigator container)
at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventClick.Play(Document document, BindingServices bindingServices, EventLogProcessor eventLogProcessor)
at Microsoft.Office.InfoPath.Server.DocumentLifetime.Event.PlayEvent(Document document, BindingServices bindingServices, EventLogProcessor eventLogProcessor)
at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventLogProcessor.<>c__DisplayClass1.b__0()
at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventLogProcessor.ExecuteLog(Int32 expectedEventLogID)
at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.<>c__DisplayClass6.b__3()
at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)

And the simple solution to this error is to replace your multiline field and replace them with "common" plain text fields. And, tada, you are able to mail the form again!

"Save site as template" is missing... or?

Yes but it's available with a little trick :)

If you try to save a website as a template, you'll find out that there is no link to it in administration mode (web site settings). You must change the following in the URL and it will be available:
Change from this URL:
http://mywebsite/sitedirectory/minsubsite/default.aspx
To this URL:
http://mywebsite/sitedirectory/minsubsite/_layouts/savetmpl.aspx
and you may save your website as a template!

Application pool id and w3wp

To find out which application pool runs a certain w3wp.exe process, use the command:
C:\WINDOWS\system32>cscript iisapp.vbs

Install IFilter on a single WSS 3.0 server

Install Ifilter for WSS3.0 on a single server using the built-in embedded SQL edition:

1) Download and install the latest Adobe Reader 8
2) Edit this registry key:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Search\Applications\{GUID}\Gather\Search\Extensions\ExtensionList
Add a new string value with Name=(next sequential number available - usually 37 or 38) and set the Data=pdf
3) Check registry key:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Search\Setup\Filters.
There should be a Key with Name=.pdfWithin the .pdf key, the following entries should be present:String Value with Name=Extension and Data=pdfBinary Value with Name=FileTypeBucket and Data=1 (0x00000001)String Value with Name=MimeTypes and Data=application/pdf
If the entries are not present, add them.
4) Check registry key:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Search\Setup\ContentIndexCommon\Filters\Extension
There should be a Key with Name=.pdfand within the .pdf Key, there should be the following:Default with Data={AdobeReaderGUID}
If the entries are not present, add them.
5) Add the Installation directory of Adobe Reader 8 to the System Path:
System Properties (Windows Key + Pause/Break key) - Advanced Tab.Click Environment Variables buttonScroll down to Path in System Variables and click EditAppend "C:\Program Files\Adobe\Reader 8\Reader" (or whatever install path) to the end of the list.
6) Restart the WSS Search service:
net stop spsearch
net start spsearch

Sharepoint 2009

Found this about the new version of Sharepoint - 2009. Exciting news!!
I am hoping for better performance, extended functions, improved CMS and well, the list is long!
Seems like they are developing the offline function - or rather - I know they are since I was interviewed by a developer at Microsoft regarding my experiences of using offline. And they are totally bad. Groove may work fine but I am not so impressed by it, to be honest. You have to learn Groove, and when you save a file it is saved in a folder - it does not tell you where in your portal the file belongs. I have tried some third part products like Syntergy, and they work quite well - I really hope Microsoft develop their own builtin solution in the next version.

These are some features in Sharepoint 2009 to look forward to :)

* SharePoint v4 will be able to render a greater set of Office documents in an HTML environment
* Knowledge Management
* More rich reporting tools over Record Management
* More rich features such like
- Print features
- Scan Documents (Shipped with the box IFilters to support more search over content)
- More support for Shell Commands
- Object Model more extendible and rich with SOA models.
- Master Data Management (designed to manage common reference data for systems through an enterprise)
- Extremely improved UI en UX (Think Tafiti, Silverlight)
- Deliver improved search relevancy
- Include tighter integration of unified communications, unified identity, and unified policy/compliance/support across all apps and for all devices
- Improve SharePoint's offline capabilities.
- "14" will ONLY be released on a 64 bit platform. That is there will be no future 32 bit releases.
- Claims based authentication
- Better support on web 2.0
- Deeper unification of communications
- Content tagging/rating
- BI capabilities to business processes
- better management of complex documents and content
- a flexible storage solution for Digital Asset Management

Hide controls on a publishing page

When you build publishing pages in Sharepoint Designer you may want to hide some fields while it's in read mode. I usually want to hide fields like "Archive date", "Target group" and so on, and to do that you simply put them in an Edit panel. Now the fields are visible in edit mode, but hidden in read mode. That's really neat, since it's ugly to have a lot of fields when the page is in read mode. But I still want to be able to use the content of those "hidden" fields to sort the pages, or to filter information. Useful!