Wednesday, May 30, 2012

Limited Access Issue Continued

In a previous post, I talked about a user that had limited access to a folder within a document library, but no access to the library, nor the site, and the user was not able to access the folder despite being given access.  Microsoft helped me solve that issue by disabling viewformpageslockdown.

However, the issue persisted on a couple of sites within the site collection, even though the site collection at large was fixed.  The only commonality with the sites that were still having problems was that I had used Metalogix Migration tool to copy the entire site over to the new environment from SharePoint 2007 to 2010.  Most of the other sites, I used the tool to copy data (i.e. lists and libraries), but not the entire site.  I had setup the site on the new environment and copied information into it.


After a lot of frustrating poking around, I noticed this within permission levels for the site:




If you go to Site Permissions for the particular site, there is a Permission Levels button that takes you to permission levels for the individual site.  I clicked Inherit Permission Levels and it fixed the problem for that site.  After clicking that, the Permission Levels button disappeared for that site, now I can only access permission levels from the root site.

Thursday, May 17, 2012

Profile Import Issues - Helpful Blog

Pictures weren't importing into SharePoint and I found this blog post to have some unique insights
http://blogs.technet.com/b/harmeetw/archive/2011/09/10/importing-thumbnail-photos-from-ad-active-directory-into-sharepoint-2010.aspx

This is an extract from the end of the blog:

Troubleshooting:

How to find if an image for a user has been imported in Sync DB
Select sAMAccountName,SPS_MV_OctetString_PictureURL from MMS_Metaverse Where SAMAccountName like '%UserName%'

How to find if an image for a user has been imported in Profile DB
Select NTname,PictureURL from UserProfile_full where NTName like ‘%UserName%’

We first import images from AD into Sync DB and then populate it into the Profile DB. By default images do not auto populate in Profile DB,we need to run the following CMDlet

Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://mysite

Image type issues
Best way to troubleshoot this issue is by creating a simple JPG file from MSPaint and then upload it to the Active Directory, if this comes through then you will need to check out the file types or the size issues.

Wednesday, May 16, 2012

Powershell - Creating a SharePoint Group w/Another Group as Owner

I wanted to create a SharePoint group on a site collection with:
  • No rights to any sites, just create the group
  • A sharepoint group as the owner of the new group
  • Done using Powershell
$siteURL="http://sitecollection/"
$webName = "sitename"
$spWeb=$spSite.OpenWeb($webName)
[Microsoft.SharePoint.SPMember]$GroupOwner = $spWeb.SiteGroups["Group Name"]
$newGroup = $spWeb.SiteGroups.Add("Group Name", $GroupOwner, $null, "Description")

For reference, you could replace the $null with a user that you would like to be a part of the group

I think that's everything, I pulled everything I thought was necessary from a much larger script.

Tuesday, May 15, 2012

InfoPath form Migration

I needed to move a bunch of InfoPath forms from one library to another, because I re-created the infopath template on a new server.  I needed to preserve the historical data, however, the individual forms (XML Files) reference the old library, so I needed to change all of the URLs in all of the XML files to point to the new server. This script allowed me to do that.

$files = get-childitem .\ToDo

foreach ($file in $files){
     (Get-Content c:\XmlFiles\ToDo\$file) |
     Foreach-Object {$_ -replace      "http://OldSiteCollection/Path/Forms/template.xsn",      "http://NewSiteCollection.com/path/Forms/template.xsn"} |
     Set-Content c:\XmlFiles\Done\$file
}

I copied all of the InfoPath forms to a directory (c:\XmlFiles\ToDo) on my computer and created an output directory (c:\XmlFiles\Done), then ran the script.