This is more “for the record” than it makes real sense. But why not? For a few years “PS2EXE” was represented on Technet and has over 90.000 downloads to date. That is super great. – Meanwhile there is also a successor, which I didn’t develop, but it seems to be alive. That makes me happy, even if a bit wistful, because I didn’t manage to stay on the ball with this little project.
Today I got an error on my development farm after I updated SP 2013 to SP1 level. I also removed Visual Studio 2012 from the box and installed Visual Studio 2013.
In fact I did the SP1 update as last step.
Than I tried to run the “SharePoint 2013 Products Configuration Wizard” and got this error in the first update step (“Initializing…”):
One ore more typed failed to load.
I was pretty sure this error was caused by the Visual Studio “update”
Could not load file or assembly ‘Microsoft.Data.Edm, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies.
Could not load file or assembly ‘Microsoft.Data.OData, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies.
After some research I found this two components belong to “WCF Data Services 5.0 for OData V3”.
In the last couple of months I got several times the following error:
The Managed Metadata Service Application was not accessible in the Central Administration.
I checked all know issues of missing security settings of the service application and in the database. – Everything as expected.
Some days before it worked like a charm.
In one case I saw the problem appear after deploying the (new) Service Pack 1.
In the ULS is this error:
Failed to get term store for proxy ‘Managed Metadata Service Application’. Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at Microsoft.SharePoint.Taxonomy.Internal.XmlDataReader.GetDateTime(String name)
at Microsoft.SharePoint.Taxonomy.Internal.SharedTermStore.Initialize(IDataReader dataReader, Guid termStoreIdValue, Boolean fromPersistedData)
at Microsoft.SharePoint.Taxonomy.Internal.SharedTermStore..ctor(IDataReader dataReader, Guid termStoreId, Boolean fromPersistedData)
at Microsoft.SharePoint.Taxonomy.Internal.DataAccessManager.GetTermStoreData(MetadataWebServiceApplicationProxy sharedServiceProxy, Boolean& partitionCreated)
Searching the internet I found no solution but exactly the same error, e.g:
backup-spfarm -BackupMethod full -Directory \\kcdevsqlexch1\backup\SvcApp -item “Farm\Shared Services\Shared Services Applications\Managed Metadata Service Application” -verbose
backup-spfarm -BackupMethod full -Directory \\kcdevsqlexch1\backup\SvcAppProxy -item “Farm\Shared Services\Shared Services Proxies\Managed Metadata Service Application” -verbose
You can get the “item” path from command:
Backup-SPFarm -ShowTree
The names maybe different on your system.
You need to create a network share for the backup data.
3. After that I deleted the service application using the Central Administration. Including the database.
4. Now I run the restore commands in PowerShell:
Restore-SPFarm -Directory \\kcdevsqlexch1\backup\SvcApp -RestoreMethod New -Verbose
Restore-SPFarm -Directory \\kcdevsqlexch1\backup\SvcAppProxy -RestoreMethod New -Verbose
5. The next thing was to add the restored service application to the service application proxy groups, in my case only the “Default” proxy group.
6. The last step was to check security settings and service application properties. In my case I had to restore the settings and security manually.
That’s it. Managed Metadata Service Application working again. No data lost.
If you want to follow these steps make sure you have tested everything yourself. Make database backups. Note all settings. As always you do it on your own risk!
One of my customers has a SharePoint 2013 farm with content migrated from SharePoint 2010.
In the past on SharePoint 2010 they have had the Microsoft SQL Server 2008 R2 Reporting Services-Add-In for SharePoint enabled on some sites. Because they did not need it any more they removed it from SharePoint but without deactivating the Report Server feature on each site collection.
Now on SharePoint 2013 this lead to problems with 3 orphaned content types:
Report Builder Model
Report Builder Report
Report Data Source
First I tried to remove the corresponding feature “ReportServer” with ID e8389ec7-70fd-4179-a1c4-6fcb4342d7a0 from the site:
The second (that I will not link here) said: The only way is to modify the content database directory. – NEVER EVER.
At last I found another way to get rid of the orphaned site collections.
In the following demo I use the content types of the Microsoft SQL Server 2008 R2 Reporting Services SharePoint Addon. I installed it on a SharePoint 2010 platform and created a site collection “https://sp2010.kc-dev.com/sites/reportingservices” in a seperate content database.
Than I checked the usage of the content types using the static method GetUsage of Microsoft.SharePoint.SPContentTypeUsage.
In my case all 3 content types are used in a single list. It is necessary to remove each usage of each content type!! – In my case I deleted the list. After deletation it need to be removed from the recycle bin too!
… and also from the site collection recycle bin!
Now my site collection is clean. No results when checking the usage again:
After that I created a new folder in the FEATURES sub folder in the SharePoint hive:
Than I created the following script to create a dummy feature inside this folder. The dummy feature uses EXACLTY the same feature Id as the missing feature containing the orphaned content types.
Note #1: The feature ID is the same as for the original Reporting Services feature!
Note #2: For this content types it is necessary to remove the XmlDocuments tag and ist content. Otherwise the next step will fail.
With that script I took the cotnent type XML out of SharePoint into a elements.xml file.
Than I was able to install the feature using PowerShell:
At this point the missing feature is back in SharePoint. The system now will not moan if I deactivate the feature.
BEFORE deactivating I made a screenshot of the site content types page:
After this command…
… the site content types page looks like this:
The orphaned content types are gone!
Note: Maybe you get an error during deactivation saying the feature is not active at the scope. In this case you need to activate the feature first and deactivate it afterwards!
Also to the masterpage catalog of this site I uploaded a script file named “crosssitescripting.js” containing the REST call to http://tohere.kc-dev.com/_api .
On the homepage of the root site collection of http://fromhere.kc-dev.com I added some script tags to load the script files jQuery.js and crosssitescripting.js. And a div tag for the sub web list.
I opened the homepage of http://fromhere.kc-dev.com in the browser and got an error in the F12 dev tools of the Internet Explorer. As expected.
Today I want to show you a small PowerShell snippet that I created for a webinar for AvePoint. It’s a webinar in German language about the DocAve module “Content Manager”.
The snippet will show you how to store a encrypted password in a plain text file.
Therefore I use some Windows OS APIs that are accessible in .NET:
With the methods of this class you are able to encrypt and decrypt data very easily, either in the context of the current user or in the context of the local machine.
The encrypted data can only be decrypted on the same machine in the same context as where they were encrypted.
I have had a strange error today in my dev lab environment. First I recognized that I could not select users from the People Picker:
Sorry, we’re having trouble reaching the server.
Second I realized that I was not able to use any function that belongs to WCF web services such as the SharePoint REST API, e.g. at http(s)://<server>/_api/web.
Using Fiddler I found this behavior:
HTTP 404 NOT FOUND on /_vti_bin/client.svc/ProcessQuery
Same for /_vti_bin/client.svc/web which is the same as /_api/web.
Search the web I found some hints regarding this error in SharePoint. But nothing worked.
Than I created a own web service “service1.svc” with a simple method in it and placed it in folder <SP-Hive>\isapi where the virtual folder “_vti_bin” is located on the file system.
Result: I could not call my own web service too. Same result: NOT FOUND.
Than I search the web for “WCF 404” and found some hints to “HTTP Activation” feature of Windows Server OS. Of course this was activated for .NET 3.5 and .NET 4.5.
So I deactivated the “HTTP Activation” feature of .NET 3.5 and .NET 4.5 and re-enabled one by one (1st .NET 3.5, 2nd .NET 4.5 ) them after deactivation.
After that I did a IISRESET. – Than everything works again as expected. 🙂