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

 

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]

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:

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

 

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 πŸ™‚

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

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.

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.