Monday, October 29, 2012

Delete sites with "Internal server error" messages

I inherited permissions on a site the other day and boom! Got an Error message and then.... the site got the annoying "500 Internal server error" and was no longer accessible. Great. No immediate cause in the log files, though scanned them up and down. Enabled custom errors in web.config and got this error:
"The DataSourceID of 'TopNavigationMenuV4' must be of the ID of a control of type IHierarchicalDataSource. A control with ID 'topSiteMap' could not be found."


Wow. What the hell is that. Googled it and found a SQL query you could run in your db to fix this. But that only ended up in "0 rows affected" so no luck. I guess there were more errors than just this...
 
Tried all possible ways to access the sites like adding _layouts/settings.aspx, adding ?contents=1 after welcome.aspx, opened Manage content and structure but the site was not listed there, opened Site Settings and Site hierarchy and clicked on Manage (strangely enough the link to the site and subsites was still in there) but all I got was the "Internal server error" message.
I googled to death to find a solution but there seemed to be none that worked for me. But found this article on MS that this is a known issue: http://support.microsoft.com/kb/937038. But that is for MOSS and we are on SP2010 so did not dare apply that.

Seemed like the only solution was to restore the site.
But I could not restore it back to its original place since the sites were still there... even if I tried the force command I could not overwrite the sites (using the Import-SPWeb and -force). Error in Powershell was cannot find an spweb object with ID or URL...
Could not delete the site through Powershell command delete either (Remove-SPWeb). Same error in powershell as above.

Finally found a command that worked though and that is run through STSADM in Powershell:

1) First enum all sites stsadm -o enumallwebs -databasename WSS_YourDBname
2) Then you need to find out what GUID the db's has (I usually export them to a txt file for easy copy)
Get-SPWebApplication "http://spserver/" | Get-SPSite -Limit All | Get-SPWeb -Limit All | Select Title, ID, URL | out-file d:\webs.txt | format-table -auto
3) In Powershell enter this command
stsadm -o deleteweb -force -webid "GUID" -databaseserver yourdbserver\instancename -databasename WSS_YourDBname

This will delete the sites.
Some of these deletions can take a looong time. But just leave it running, do not interrupt it.

 

Tuesday, September 18, 2012

Substring in InfoPath

To get a value AFTER a character
substring-after(FieldName, ";")
This will return all text after the character ;


To get a value BEFORE a character
 substring-after(FieldName, ";")
This will return all text before the character ;


Substring and Concatenate

I often use Concatenate to join text from two fields. For example, the Date function now() has a "T" between Date and Time. I usually create a new field where I use substring and concatenate to replace the T with a space. Formula:

concat(substring-before(DateTimeField; "T"), " ",substring-after(DateTimeField; "T"))

This gives me the date and time in one single field with a space between.

 

Working with Date formats in InfoPath

To extract the day number of a date

number(substring(DateField, 9, 2))


To extract the month number of a date
number(substring(DateField, 6, 2))


To extract the year number of a date
number(substring(DateField, 1, 4))


Calculate hours

addSeconds(now(), 7200)


Get the month name from a date (and time) field

=TEXT([DateField];"mmmm")


Get three characters of the month name
=TEXT([DateField];"mmm")


Sort or group a view by month name

To sort, add the month number in front
=TEXT(month([DateField]); "00")&" "&TEXT([DateField];"mmmm")

Add two calculated columns that will take the start and the end of the month.

"Start of Month"  =DATE(YEAR([DateField]), MONTH([DateField]), 1)

"End of Month"    =DATE(YEAR([DateField]), MONTH([DateField])+1,1)-1

Add a filter in the view:
"Start of Month" is less than or equal to [Today]
 AND
"End of Month" is greater than or equal to [Today]

Sunday, September 16, 2012

Error in the personal information on MySite

If you see this error on the MySite and personal information page:

"There was a problem retrieving data for this field. Updating values in this field is disabled temporarily. You can still update values in other fields."




Then something is wrong with the Managed Metadata Service. Clicked on the service app for Managed Metadata service and got the following error:


So check the following things to fix this:

* In CA, Services on server, restart the Managed metadata service

* In CA, verify that the Service Application is associated to the MySites web app
* Is the Application pool started

* In EventViewer, look for errors. I had this error (8088, The managed metadata service is inaccessible):



* So that error in Event Viewer made me check the Site Collection Administrators on the Content Type hub site, and the service account was removed (for some strange reason...) so I added the it again, and the Managemed Metadata and MySite started working immediately:

Wednesday, August 29, 2012

Form has been closed

This post is more for my own memory, since I tend to forget how I solved it when I get this message "Form has been closed" when submitting browser forms in InfoPath :)

Scenario is the following:
You have a mail view that you wish to mail instead of the default Edit form, so that you can design it better for mail clients and also remove any unrelevant information and buttons etc. So I have two views in my InfoPath form, and my Submit button should change to the Mail view when the form is submitted.
I add a Submit button and some rules. If you add the rules in the wrong order and you submit the form, you will get this message in the browser:
And you are not redirected back into the form library, which is what you want. So in order to get back into the form library after Submit, then add the rules in the following order on your Submit button:

1) Submit to library
2) Switch to your Mail view and Submit to Email
3) Switch back to View1 (default view) and Close form




 

Saturday, August 18, 2012

Installation of Windows 8

Today I installed Windows 8 on my laptop. It was very fast and easy, I did these steps:

Booted on USB

Since I ran a Home Edition of Windows 7, I was not able to select "Upgrade" since I am installing an Enterprise version. So it had to be "Custom: Install Windows only (advanced)" which means a complete reinstallation. You have to select what partition to install it on.

Make sure you backup all files and programs before you continue!


Select Language and keyboard settings


You can personalize more after installation is done


There actually is a short introduction to the new UI during the installation


I must admit that this new UI will take time to get used to. I find it quite confusing sometimes, where to click to get out fast. I see my self as a very experienced user and I have problems remembering where to click etc. Found this video on YouTube today which shows how a "real" user experience Windows 8. He is really struggling to find his way around in the UI!

I don't know if this is related to the problem I have with activating my Windows copy, but the sound is not working and the video playback is in slow motion (?). I have to google that a bit. Otherwise it is a new and fresh experience, somewhat confusing from time to time. And I am quite fast when I work with computers, but now I can't be that because I don't know all the fast shortcuts and where to click to fast access things. Guess it will take a while to learn :)

Hmm I have already freaked out a couple of times today in frustration over not finding stuff.....
Like the Start screen in the lower left corner, come on! You have to be so precise to get it, and that is annoying for all these "clicking in the corners". I know what I will use the most, that is the good old Desktop :)

Friday, August 17, 2012

New setting for AD import

Use SharePoint Active Directory Import - User Profiles

Instead of using the default setting of synchronization of User Profiles, you can select the "Use SharePoint Active Directory Import" setting. Which is a lighter version and which only imports information from the AD. If you had a connection before, it is lost when you click on this setting.
First you need to create a new connection again. You will notice a good difference here: you can click on "Filter out disabled users"! Very good.

You can no longer click on "Edit connection filters".


You cannot edit the User Properties, such as adding the thumbnailPhoto to the Picture property.

Noderunner.exe

My SP2013 server was getting slower and slower and I could not even create a site collection anymore, so I looked into Task Manager and the processes. Found a new one, noderunner.exe, and it was consuming a lot of CPU

That process is the Search service, with a new process name. Restarted the SharePoint Search Host Controller service and the performance looked a bit healthier after that

Tuesday, August 7, 2012

Limits and restrictions in SP2013

Most intranets I have worked with are used more or less as a file server (I struggle hard with getting users to organize the files with tags rather than folders, but users are lazy and they often end up dragging files directly from the file server with folder structures that are huge), so the content db often grows large very fast. So it is always interesting to look at the boundaries and limits in SP2013.

This information is from technet and below here is what I find of interest. All information below is what Microsoft recommends:
Document size limit

You cannot configure SharePoint Server 2013 Preview to store documents that are larger than 2 GB This is a built-in absolute value, and cannot be exceeded by design.

Warning

There are some limits that you can exceed the default values of, but as you increase the limit value, farm performance and the effective value of other limits may be affected so it is at your own risk.

Recommended guidelines for general stuff

These limits are set so high that the company I work with never have to be bothered at least...

300 content databases per Web application

250,00 site collections per Web application.

Microsoft strongly recommends limiting the number of site collections in a content database to 2,000. However, up to 5,000 site collections in a database are supported

10 application pools per Web server

Content databases

Microsoft strongly recommend limiting the size of content databases to 200 GB, except when the circumstances in the following apply:
If you are using Remote BLOB Storage (RBS), the total volume of remote BLOB storage and metadata in the content database must not exceed this limit

Content databases of up to 4 TB are supported when the following requirements are met:
Disk sub-system performance of 0.25 IOPs per GB. 2 IIOPs per GB is recommended for optimal performance. You must have developed plans for high availability, disaster recovery, future capacity, and performance testing.
(We are not using SP backup, we manage backup using third party products.)

If you exceed the limit:
Upgrading of site collections within these content databases is likely to be very difficult and time consuming. It is strongly recommended that you scale out across multiple content databases, rather than exceed 4 TB of data in a single content database.

Content databases with no explicit size limit for use in document archive scenarios are supported when the following requirements are met:
You must meet all requirements from the “Content database size of up to 4 TB" limit earlier in this article, and you should ensure that you have carefully considered all the factors of that limit.
The sites must be based on Document Center or Records Center site templates. Less than 5% of the content in the content database is accessed each month on average, and less than 1% of content is modified or written each month on average. Do not use alerts, workflows, link fix-ups, or item level security on any SharePoint Server 2013 Preview objects in the content database

More limits... sure

Of course there are a lot of other limits and boundaries, but they are in such a large scale (as mentioned before) that I will never run into those limits anyway. If you are interested in those, find more on the technet link above.

Wednesday, August 1, 2012

Some LIKES and DISLIKES in SP2013... (more to come)

LIKE

Metro (or whatever the new design is called)

Yes I like it. Simple, easy but still a bit ugly/boring. Squares, single colors, no shades, no fancy pancy icons, simple colors and BIG characters. Ah well, it is OK :)

Import picture from computer

It may not seem as much but it is nice news! You may now import a picture from your computer without first having to upload it into the site....


Design Manager

I like this! This is new with 2013 and a great step forward when it comes to design! Find a shortcut on the Settings menu up in the right corner


Here you have a step by step list on how to change the design of your site

On the first Welcome page you can click on "Pick a pre-installed look" to easily change the theme of your site by choosing between a set of predesigned layouts, just like a blog tool. Although I could not find one theme that I liked, but you can of course create your own. I like the concept! Very nice :) 


I tried the pink theme, but huuua! :) Anyway, nice with the Preview and No thanks options :)


You can add your own background image and also change color scales, very cool! For those who do not want to dig into the css and html code, this is awesome.


You can create your own design package, click the last link in the Design Manager to generate a wsp file

Knock yourself out ;)


DISLIKE

"Sign in as a different user" - removed!!

Why like this Microsoft?! That was one of the best features of the personal menu. I use it a lot to test permissions and to see how a site looks for a Reader for instance. Shit. Found a blog that has the solution, but still - that is not what you want to do!

Here is how it looks default, "Sign in as a different user" is gone


And after modifying Welcome.ascx (which is a non recommendation and a crappy solution!)



User Profile Services

I still miss a link back to "Manage service applications" from the User Profile Service App. The two most used service apps are Search and User Profiles, at least in my server farm. I am using bookmarks for these...


A bit disappointing that the user profiles app has not been improved. There are a lot of things that could be better, for instance speed of the AD connection. Come on, that should be lightning fast, but in SharePoint it takes for ever after you have setup your connection (if you want to edit your AD containers for instance... zzzz). Also the filters could be easier to set.

Tuesday, July 31, 2012

Configure the SP2013 server

I must say that I am not too fond of the Metro style in SharePoint 2013 and Office 2013. It looks very simple and ugly, but I will probably get used to it... I have always branded SP sites to have the company look & feel (which sometimes is hell as you all know who have worked with the css files), but in this version it does not feel necessary since it will be used on more mobile platforms and you don't want too many design elements on those sites. So I do understand why the metro style is incorporated, but it is still ugly :)

Now the fun part begins, configuring your first SP 2013 server!! This is the first screen that loads after you have run the Configuration Wizard



I want to setup all databases my self so that I can have a better naming standard than the wizard gives. So hit the Cancel button and start creating dbs!

You come to the Central Administration first page and my eyes are drawn to the new section of CA: Apps! Cool. There is a link both in the left side menu and as a section on the CA page. Guess they have not yet figured out what the icon should look like

Service Applications

But before I dig into the new stuff I must create the service apps and set everything up. The two default apps are "Application Discovery and Load Balancer Service Application" and the "Security Token Service Application"



Here are some news also, in the Service Application list (see red marks). And the Web Analytics db is gone from the list.


Search Service

I will start with the Search Service App. I used the same search account for all app pools since it is on my test server. The search service app created the following apps and the WSS_UsageApplication was in Stopped mode, just as in SP2010


The Search Application has a better organized left side menu, and some new stuff. Will dig into this more later. For now, I only setup the search schedules so I know that search is running. And there was this new setting: Continous crawling. No need to setup incremental crawls, I like! Enabled.



Managed Metadata

Created the Managed Metadata Service Application. No news there as far as I could see. When I clicked the link to open the Managed Metadata app I got a red error message that the Service or App Pool was not started. But I had started the Managed Metadata service so I did an IISRESET and that helped




User Profiles

Moving on to the User Profile Service App. I always create the MySite host from here


And now for the most exciting click, enter the new UPS app. Oh yeah, forgot, first start the SERVICES!! It is so annoying that the services for the common service apps don't get started when you create them

Start the two services


A bit simplified interface. Just add the farm account and password


And wait for that "Starting" to change into "Started".... always exciting.... Now get a coffee or something, because this will take time



Wohoo! Some 20 minutes later, the service actually got started!



A few new links, other than that - you feel at home here


Created a new connection no change there! It is still quite slow to expand and collapse the AD containers :(

Creating the connection filter is the same as in 2010, same shit I would say. Not logical stuff in here at all, unless you are a true AD nerd. I always have to google this because I want to exclude the disabled accounts and you cannot guess your way to do that... This is what you have to set

UserAccountControl (wait...) Bit on equals 2




Top ribbon

There is a new top ribbon which I have not decided if I like or not, yet.. What I do like is the right part of it in the grey area with shortcuts to permissions and content in focus. All of the blue links seems to take you to MySite, now at least. And the left most is totally meaningless but I guess that will change.



Select experience

When you create a site collection, you can select Experience (2010 or 2013)



Working on it... (Puking on it)

This message is going to drive me mad, I am already sick of it!


And don't be sorry FFS!! Arrrgh..


Apps

Seriously, are document libraries and lists to be called APPS now?