Monday, March 30, 2015

Export Term Set to Excel - SharePoint Metadata Services - Powershell Script

# Add SharePoint PowerShell Snapin
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

 # File and Directory Location
$dirLocation = "D:\temp\TermStore\"
$date = get-date -Format yyyyMMdd
New-Item ($dirLocation + $date) -Type Directory | Out-Null
$file = New-Object System.IO.StreamWriter(($dirLocation + $date) + "\Terms.csv")

# Connect to site with MMS service connection
$taxonomySite = Get-SPSite -Limit 1
 
# Connect to Term Store in the Managed Metadata Service Application
$taxonomySession = Get-SPTaxonomySession -site $taxonomySite
$taxonomyTermStore =  $taxonomySession.TermStores | Select Name
$termStore = $taxonomySession.TermStores[$taxonomyTermStore.Name]

# Ampersands are stored as full width ampersands within the MMS database.
[Byte[]] $amp = 0xEF,0xBC,0x86

# CSV headers
$file.Writeline("Term Name,Id,Owner,CreatedDate,LastModifiedDate,TermSet,TermSetOpenStatus,GroupName")

# Term counter
$i = 0

foreach ($group in $termStore.Groups) {
    foreach ($termSet in $group.TermSets) {
        foreach ($term in $termSet.GetAllTerms()) {
            [Byte[]] $amp = 0xEF,0xBC,0x86;
            $file.Writeline("""" + $term.Name.Replace([System.Text.Encoding]::UTF8.GetString($amp), "&") + """" + "," + $term.Id + "," + $term.Owner + "," + $term.CreatedDate + "," + $term.LastModifiedDate + "," + $term.TermSet.Name + "," + $term.TermSet.IsOpenForTermCreation + "," + $term.TermSet.Group.Name);
            $i++
            Write-Host -ForegroundColor Cyan  "# Exporting TermSet: " -NoNewline
            Write-Host -ForegroundColor White $termSet.Name -NoNewline
            Write-Host -ForegroundColor Cyan  " Term: " -NoNewline
            Write-Host -ForegroundColor White $term.Name -NoNewline
            Write-Host -ForegroundColor Green " - Done"        
            }          
        }              
    }
$file.Flush()
$file.Close()

Write-Host
Write-Host -ForegroundColor Cyan  "# Exported " -NoNewline
Write-Host -ForegroundColor Green  $i -NoNewline
Write-Host -ForegroundColor Cyan  " terms"

Thursday, January 29, 2015

Wednesday, January 28, 2015

Error while crawling MySite users wherein MySite Web application is set up with SSL

Error Message:

sps3s://www.domain.com/site$$$people/bucketid=1/itemid=539

An unrecognized HTTP response was received when attempting to crawl this item. Verify whether the item can be accessed using your browser. ( WebExceptionStatus: TrustFailure The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.; SearchID = 22908598-2E57-4053-96F5-FBB55B029959 )


Solution:

Ensure the SSL cert is registered under "Manage trust" in SharePoint central Admin


Step 1: Export the SSL Certificate
  •  Open the cert from browser. Click on the lock  in address bar 
  • Go to the tab called “Certification Path”, select the root CA certificate and click “View Certificate”
  • Select the “Details” tab and click on “Copy to file”
  • Save the file in your machine

Step 1: Import it in SP Central Admin


  • Go to SP Central Administration  / Security / Manage Trust. Click on “New”, add the root CA certificate from the local machine 



This should do the trick



Monday, January 05, 2015

User Profile not showing up with proper domain name: User profile sync issues

User are showing up with  different domain name after full profile sync.

For e.g . I have all the users defined in ABC domain but after sync some users are showing up as different domain.

expected users in User Profile : ABC\user1
but showing up as : DEF\user1

Note: There is no domain with name DEF but it still shows up that way.

One of the possible reason is Domain netbios name is different than the FQDN of the domain

Check out article below , section Permission requirements: Domain netbios name is different than the FQDN of the domain

http://blogs.msdn.com/b/russmax/archive/2010/03/20/sharepoint-2010-provisioning-user-profile-synchronization.aspx


Gray Failures: What is it and how to detect one?

If you are reading this article , i guess you are curious to know about gray failures and different methods to detect gray failures.  Hopefu...