Posts mit dem Label SharePoint 2010 werden angezeigt. Alle Posts anzeigen
Posts mit dem Label SharePoint 2010 werden angezeigt. Alle Posts anzeigen

Montag, 4. Februar 2013

Site Provisioning Best Practice

 

Site Provisioning is always important in SharePoint Projects. In this article I’ll put every interesting information on this subject.

Even if its about SharePoint 2010, following Post is really interesting and in my eyes a must read: SharePoint 2010 and web templates.

So what are the different Provisioning Possibilities:

1 Full-blown Site Definition:

In my opinion site Definitions are not really an option because it’s not supported to change the onet.xml once a single Site is provisioned using this site definition. A possible Workaround is the “minimal Site Definition approach”.

2 minimal Site Definition

I’ll update this part once I explore this possibility.

3 WebTemplates

I tried Vesa Juvonen’s solution in the above linked Post. It worked fine even with SharePoint 2013. I just needed make some small changes.

So What Changed in SharePoint 2013?

In 2013 It seems to me that deploying a Web with a WebTemplate will fail if some features from the <SiteFeatures> section of the web Onet.xml are not activated.

So this part was not working:

image

I simply included this part in the WebFeature part:

image

Donnerstag, 17. Januar 2013

The trial period for this product has expired.

 

Recently after some windows updates i got this error on my SharePoint sites.

image

In the SharePoint Log-files I found this error:

Failure checking user access permissions for User Profile Application Proxy 'User Profile Service Application'. Exception: Microsoft.SharePoint.SPException: The trial period for this product has expired.

I found this Blogentry

So I tried first the solution at the end of the article, becose the first one semed to be awkward. I did this

psconfig -cmd secureresources

Still the same error, even after an iisreset and a server restart.

I found there in the comments a link to a technet entry and then found the solution:

Workaround: In central admin go to "Central Admin" => Monitoring => "Review Rule Definitions" => click on "Trial period for this product is about to expire" rule under configuration and edit it. Uncheck the "Enabled" checkbox.

image

image

So I did this.

Still the same error even after iisreset.

So I got back and tried the first Ugly solution.

Still the same error even after iisreset.

In the IIS I found this:

image

So I started the The web Services Application

Still the same error even after iisreset.

And I’m still searching for a solution.

Finally I looked in SharePoint central Administration – Upgrade and Migration - Convert farm license type. And there I found the problem:

image

After an iisreset everything went well.

Sometimes error messages are really what they seems to be. Even Microsoft error Messages.

Dienstag, 19. Juni 2012

SharePoint 2010 Cumulative Updates installation order


Are you about to update your outdated SharePoint 2010 installation and wondering if you need to apply all Cumulative updates in release order or just the latest one? The answer is: Just the latest one. That’s why it’s called Cumulative Updates, they include all previous fixes since the last Service Pack.


More information on the technet site

Sonntag, 22. April 2012

Clear WebConfigModifications using powershell

While playing arround with the SPWebConfigModification Class I added some wrong entries to the web.config. These entries where added every time I activated or deactivated my feature. It seemed the WebConfigModifications of the WebApplication object had some corrupt entries. So I found this blog. David Petersen explains how to clear these WebConfigModifications using code in a console application.

This was very helpfull and solved my Problem. But instead of creating a console application I simply made a PowerShell Script. The code is basically the same but I wanted to add it here for those who are still afraid of using PoweShell. Don't be. Powershell just rocks ;)


$siteUrl = "http://yoursiteurl/";
$site = $gc | Get-SPSite -Identity $siteUrl
[Microsoft.SharePoint.Administration.SPWebApplication]$webApp = $site.WebApplication
$webApp.WebConfigModifications.Clear();
$webApp.Update();
[Microsoft.SharePoint.Administration.SPWebService] $service =[Microsoft.SharePoint.Administration.SPWebService]::ContentService
$service.WebConfigModifications.Clear();
$service.Update();
$service.ApplyWebConfigModifications();


Finally just be careful because this code removes all modifications not only yours. So don’t use it on productive environments.

Freitag, 13. April 2012

Alternate Access Mapping not Working in a developper environment


I installed SharePoint 2010 in a virtual machine. I created a WebApplication and a SiteCollection on this WebApplication. Then I extended this WebApplication with a new host Header and a made sure that the bindings in the IIS Settings were set right. Then I created a new Zone and a new Host(A) in the VM DNS Manager. You can find a lot of blogs describing how you need to proceed for this. But the Alternate URL was still not working. And I always got the error Message: 

"Internet Explorer cannot display the webpage"

I spend a lot of time searching for the error. Finally I found what I forgot. I admit it's a dumb mistake, but I think the hint could save some time to some people around here:

Don't forget to enter the IP Address of your virtual machine as an alternate DNS Server in your Network Connection Properties:

Dienstag, 27. März 2012

Moving a SharePoint site Collection to another managed Path using PowerShell


I recently needed to move a Site Collection from one managed path to another. I found this blog using stsadm commands. I translated this to a PowerShell script: 


$fromUrl = "http://portal.dev/sites/TestSiteCollection"
$toUrl = "http:// portal.dev"

$backupPath = "c:\siteBackup"
Backup-SPSite $fromUrl -Path $backupPath -force
Remove-SPSite -Identity $fromUrl -Confirm:$false
Restore-SPSite -Identity $toUrl -Path $backupPath -Confirm:$false

Samstag, 24. März 2012

Adding SharePoint Shell access to an Admin Account

I was recently added as administrator to a SharePoint server farm. I was able to access the Central Administration with no problem. But the issue was that PowerShell was not working. I got this error message when I started the "SharePoint 2010 Management Shell":

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered..



Also when I tried to start the SharePoint Manager 2010 I get this error: "Object reference not set to an instance of an object"

I have had this error before and I got a lot of trouble with Powergui at that Time too. To get this work you need make sure the logged user has rights to the SharePoint Configuration Database (db_owner and SharePoint_Shell_Access)

But be aware that direct changes to the SharePoint DB are not supported by Microsoft. To make this right use the Add-SPShellAdmin PowerShell command with an Administrator account:

Add-SPShellAdmin -username MyUserName


Now you can user Powershell but you will get this error when trying to access a Site with: "Get-SPWeb $url"


Cannot find SPWeb object with 'Id' or URL:"


You need to grant rigths on the content databses using this commands:

> $contentDB = get-spcontentdatabase -site http://server/site
> add-spshelladmin -UserName DOMAIN\Username -database $contentDB



Thanks to this Blog


Mittwoch, 15. Februar 2012

Set List Item Permission in SharePoint designer 2010 Workflow



A customer asked me to program a SharePoint designer action that enables to set permissions on an Item. In Moss 2007 this was definitively missing. But then after a little bit of googling (or should I say Binging?) I found out, that this action was now added in SharePoint designer 2010. 
So when I created a workflow I couldn’t find the Action in the list.


The solution was to add an impersonation step to the workflow, and see there; new Actions are available including the one to set Item Permissions






The impersonation step runs under the Author of the workflow and not the one who started the workflow



Mittwoch, 8. Februar 2012

Term Store Management base Configuration - Step by Step

Sometimes in the site collection administration the menu item Term Store Management is missing. 

This is because you created the Site Collection using the Blanc Template. I Found the solution in this Blog. In case The Blog will be removed, here is the solution:

Connect to the server, start the SharePoint 2010 Management Shell and enter this

stsadm -o activatefeature -id 73EF14B1-13A9-416b-A9B5-ECECA2B0604C -url http://toplevelsiteurl


And see there the option will appear in the site collection administration:

Now you have the problem, that you can’t add Groups or terms to your term stores. 

This is because the Managed Metadata Service is not yet configured and you don’t have the required permissions to do so.

Now Go to the central administration and click on Manage Service Applications


Mark Managed Metadate Service (click on the right side)

   

In the ribbon click on „Administrators“

Add the actual Farm administrator as an Administrator for Managed Services and don't forget to check the "Full Control" Checkbox.

Now go Back on the Manage Service Applications site and click again on the Managed Metadata Service.


On the ribbon click this time on “Manage”

And add the users that will be Term Store Administrators

Now if you’re back in the term Store management in the site collection you will be able to add a new Group and new Terms.

Please Notice: The Managed Metadata Service is only available on SharePoint Server Standard and SharePoint Server Enterprise. Don’t bother looking for it on a SharePoint Foundation.

Donnerstag, 29. September 2011

SharePoint 2010 customErrors mode

Are you getting crazy getting no error details even if you allready set customErrors to Off on the web.config?

Just read this Post, I think it may help you out:

SharePoint 2010 customErrors mode

The secret lays here:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\web.config

Dienstag, 6. September 2011

Add Circulation List to SharePoint 2010 Web using PowerShell


PowerShell is great. I'm working on scripting a whole deployment process with PowerShell. Yesterday I got stuck in a problem that costs me about 6 hours of my life. 
If you want to add a list to a SPWeb you will find in a lot of blogs this description:

$listTemplate = [Microsoft.SharePoint.SPListTemplateType]::Circulation
$spweb.Lists.Add(MyCirculation“,"Description",$listTemplate)

And guess what? It works fine for a lot of list templates. But then I tried with “Circulation” and I got this error:


Exception calling “Add” with 3 argument(s) “Invalid list template.”

I tried a lot And I found out that I need to use this Add Method:
http://msdn.microsoft.com/en-us/library/ms448694.aspx

So I tried with this code:

$listTemplate = [Microsoft.SharePoint.SPListTemplateType]:: Circulation
$spweb.Lists.Add(“MyCirculation“,"Description", $spweb.Url, "a568770a-50ba-4052-ab48-37d8029b3f47", $listTemplate, 2)

You can get the feature ID from this location “14/TEMPLATE/FEATURES/CirculationList”
here I got this error message:

Exception calling "Add" with "6" argument(s): "The file or folder name contains characters that are not permitted.  Please use a different name

So I thought the error must be in the Url but what Url does the Method require?
Finally I tried with this:


$listTemplate = [Microsoft.SharePoint.SPListTemplateType]::Circulation
$spweb.Lists.Add(“MyCirculation“,"Description", “MyCirculation“, "a568770a-50ba-4052-ab48-37d8029b3f47", $listTemplate, 2)

I don’t know why, but it worked. I just used the same thing for Title and Url.
I only tried this out with Circulations, but as whereabouts throw the same error I think the solution must be the same.

As I said this cost me about 6 hours trying and searching for a solution. I hope it will be useful to someone else.

Enjoy and Share :)