Recently I exported a publishing sub-site from SharePoint 2010 and imported it as a site collection. After the import, the pages were displaying properly, but when I tried to add a new page, I got an error "Data at the root level is invalid. Line 1, position 1". I was also not able to edit the pages or access the "Page layouts and site templates" link from the site settings, both operations were failing.
Search on the web led me to http://blog.falchionconsulting.com/index.php/2007/09/convert-a-sub-site-to-a-site-collection/. As stated in the blog, I set the __PageLayouts property of the site collection to blank instead of "__inherit". Doing so allowed me to edit the page, but still was not able to create a new page or access the "Page layouts and site templates" page.
Next, I compared the property values of the site with the issue to a site collection that was working properly. I found property value of __DefaultPageLayout set to "__inhert", so I changed that to blank, still no luck. I continued the comparison process and found a property "__InheritCurrentNavigation" set to "True". This property was not present in the site collection that was working properly, so I deleted this property from the site collection, after doing so, I was able to add a new page and access the "Page layouts and site template" page.
I found few more properties (__IneritsAlternateCssUrl, __InheritsThemedCssFolderUrl, __InheritWebTemplates) that were present in the site collection with the problem, but were not present in the site collection that was working properly. To be safe I removed them as well.
Here is a summary of changes to the properties of the site collection:
__PageLayouts - set to blank
__DefaultPageLayout - set to blank
__InheritCurrentNavigation - delete
__IneritsAlternateCssUrl - delete
__InheritsThemedCssFolderUrl - delete
__InheritWebTemplates - delete
Showing posts with label SharePoint 2010. Show all posts
Showing posts with label SharePoint 2010. Show all posts
Thursday, December 06, 2012
Wednesday, July 25, 2012
PowerShell script to add "Link to a Document" content type to all document libraries
$linkct = "Link to a Document"
$docct = "Document"
Get-SPSite -Limit all | Get-SPWeb -Limit all | ForEach-Object {
$doclibtype =[Microsoft.SharePoint.SPBaseType]::DocumentLibrary
$doclibs = $_.GetListsOfType($doclibtype)
foreach ($doclib in $doclibs)
{
$newdoclib = $_.Lists[$doclib.ID]
if ($newdoclib.AllowContentTypes)
{
$newdoclib.ContentTypesEnabled = $true
$newdoclib.Update()
#Add site content types to the list
if (($newdoclib.ContentTypes[$linkct] -eq $null) -and
($newdoclib.ContentTypes[$docct] -ne $null))
{
$ctToAdd = $_.Site.RootWeb.ContentTypes[$linkct]
$ct = $newdoclib.ContentTypes.Add($ctToAdd)
"Content type " + $ct.Name + " added to list " + $newdoclib.Title
$newdoclib.Update()
}
}
}
}
SharePoint profile image sync issue.
The SharePoint farm I manage is configured to sync the
pictures from SharePoint user profile to AD. Everything was
working like a charm until we decided to upload pictures from an internal
social media system in which users have profile images uploaded to SharePoint
for users with no images in their profile.
I updated the pictures using a powershell script and ran
Update-SPProfilePhotoStore command. I started getting the following errors in
the event log and the Profile Synchronization Service manager:
Synchronization service Manager Error –
MOSS_DELTAIMPORT_GUID stopped-extension-dll-exception
Event Log:
Event ID : 6801
Source: FIMSynchronizationService
The extensible extension returned an
unsupported error.
The stack trace is:
"System.Net.WebException: The remote
server returned an error: (404) Not Found.
at System.Net.WebClient.DownloadDataInternal(Uri address,
WebRequest& request)
at System.Net.WebClient.DownloadData(Uri address)
at Microsoft.Office.Server.UserProfiles.ManagementAgent.ProfileImportExportExtension.DownloadPictures(ProfileChangeData[]
profiles)
at
Microsoft.Office.Server.UserProfiles.ManagementAgent.ProfileImportExportExtension.Microsoft.MetadirectoryServices.IMAExtensibleFileImport.GenerateImportFile(String
fileName, String connectTo, String user, String password,
ConfigParameterCollection configParameters, Boolean fFullImport,
TypeDescriptionCollection types, String& customData)
Forefront Identity Manager
4.0.2450.34"
After trying multiple things and Googling, I came to the
conclusion that the error was due to few rouge images which SharePoint
could not convert. The problem was that I did not know the user with the problematic
image. So, I first got a list of all images from “User Photo” library in
the My Site host
$site = Get-spsite “http://mysitehost”
$web = $site.RootWeb
$list = $web.Lists["User Photos"]
$Folders = $list.RootFolder.SubFolders
foreach ($Folder in $Folders)
{
if ($Folder.Name -ne "Forms") { foreach ($item in $Folder.Files) { $item.Name } }
}
$web.Dispose();
$site.Dispose();
And then I listed down all users who had their profile
images set using the script below:
$site = Get-SPSite "http://mysitehost " $ServiceContext = Get-SPServiceContext($site); $upm = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($servicecontext)$upm.GetEnumerator() | foreach{ $pictureURL = $_["PictureURL"].Value if (($pictureURL -ne "") -and ($pictureURL -ne $null)) { $_["AccountName"].Value }}
After manipulating the results from both the scripts
using excel to find the unique user ids, I found that couple of users had their
“PictureURL” property set but did not have the corresponding mthum.jpg,
lthumb.jpg and sthumb.jpg files. I came to the conclusion that these were the users who had the offending images, since the system could not create the
corresponding images from the source image.
Next, I set the “PictureURL” property for these 2 users to blank and started
sync again. Viola, it synced the images without any issue.
Monday, March 05, 2012
The specified user or domain group was not found.
I started getting the error "The specified user or domain group was not found" after I restored a SP 2007 site to SP 2010 with claims authentication.
The event log had the above error followed by the following error:
Object Cache: The super reader account utilized by the cache does not have sufficient permissions to SharePoint databases.
To configure the account use the following command 'stsadm -o setproperty -propertyname portalsuperreaderaccount -propertyvalue account -url webappurl'. It should be configured to be an account that has Read access to the SharePoint databases.
Additional Data:
Current default super reader account: NT AUTHORITY\LOCAL SERVICE
To fix the error I had to run the following Power shell commands:
$wa = Get-SPWebApplication -Identity "http://yourwebapp"
$wa.Properties["portalsuperuseraccount"] = "domain\cacheuser"
$wa.Properties["portalsuperreaderaccount"] = "domain\cacheuser"
$wa.Update()
Labels:
Claims Authentication,
object cache,
SharePoint 2010
Monday, August 16, 2010
Configuration to use Content Type in search scope and to display the Content Type in core results web part
1. In Central Admin click on “Manage Service Applications” and select the Search service application
2. Select “Manage” from the ribbon control
Steps 3 and 4 are required if you want to display the content type data in the core results web part
3. Select “Metadata properties” from the left navigation and add a “New managed Property”
4. Give the new property a name, add crawled property mapping to Basic:5(Text) and ows_ContentType(Text), check “Allow this property to be used in scopes” and “Add managed property to custom results set retrieved on each query” check boxes. Click ok when done.

5. Select “Scopes” from the left navigation and select “New scope” to add a new scope for the content type.
Note: If you are using the inbuilt content type managed property then you have to edit the property and check “Allow this property to be used in scopes” check box.
6. After creating the new scope you should add a rule by clicking “New Rule” link.
7. In the new rule screen, check the “Property Query” for the “Scope Rule Type”
8. Select “ContentType” from the “Add Property Restriction” drop down if using the inbuilt Content type managed property if not select the managed property that you added in steps 3 and 4
9. Type in the content type name in the “=” text box below the “Add Property Restriction” drop down

10. Now drop a Core results web part to a page and set the scope to the one created in step 5
11. Add to the “Fetched Properties” under display properties of the core results web part
12. To display the raw XML that is generated, set the XSL editor property of the web part to
Tuesday, August 03, 2010
Issues with starting User Profile Synchronization Service.
Here are some of the issues I faced trying to start the User profile synchronization Service in SharePoint 2010:
1. Exception trying to write the dbName regkey for MIIS System.Security.SecurityException: Requested registry access is not allowedTo solve this error add the farm admin user to the local administrator group on the server on which the service is being started.
2. "The trust relationship between this workstation and the primary domain failed." when trying to start the User profile synchronization service.
The farm admin account needs to be given "Replicating Directory Changes" permission for the domain. Knowledge base 303972 provides the steps needed to grant "Replicating Directory Changes" permission. I am including the steps below from the above knowledge base.
Setting permissions by using the ACL editor
- Open the Active Directory Users and Computers snap-in
- On the View menu, click Advanced Features.
- Right-click the domain object, such as "company.com", and then click Properties.
- On the Security tab, if the desired user account is not listed, click Add; if the desired user account is listed, proceed to step 7.
- In the Select Users, Computers, or Groups dialog box, select the desired user account, and then click Add.
- Click OK to return to the Properties dialog box.
- Click the desired user account.
- Click to select the Replicating Directory Changes check box from the list.
- Click Apply, and then click OK.
- Close the snap-in.
Have a look at http://msmvps.com/blogs/shane/archive/2010/07/09/configuring-profile-import-in-sharepoint-2010.aspx, this covers the setup steps in detail.
Wednesday, June 09, 2010
SharePoint 2010 - An exception occurred when trying to issue security token.
Make sure that "Claims to Windows Token Service" is starte if you see the following error in the event log with SharePoint 2010:
Task Category: Claims Authentication
Source: SharePoint Foundation
Level: Error
EventData: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from theconfiguration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.
Task Category: Claims Authentication
Source: SharePoint Foundation
Level: Error
EventData: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the
Subscribe to:
Posts (Atom)