About Me

Having 12 years experience in Microsoft technologies.Since more than 7 years working in SharePoint technologies. Expert in providing consultation for SharePoint projects. Hands on with development and administration.

Tuesday 9 April 2013

Provision SP 2010 - Managed Meta Data service PowerShell Script

Following powershell script will provision Managed Metadata service.

Points to be noted:

1. Update $UserProfileServiceAccount with the account with respect to your environment.

2. Save the follwing script on some meaningful name like psProvisionManagedMetaData.ps1

3. Call the file using bacth file & it contains follwoing and save as ProvisionManagedMetaData.bat

cd /d %~dp0
powershell -noexit -file ".\psProvisionManagedMetaData.ps1" "%CD%"
pause
 
4. $CTypeHubUrl is optional, later you can set it up.
 
 
Add-PSSnapin Microsoft.SharePoint.Powershell -EA 0
$ManagedMetadataServiceName ="ManagedMetaDataAppPool"
$ManagedMetaDataServiceAccount = "xxxxxxx"
$CTypeHubUrl = ""
$saAppPoolName = New-SPServiceApplicationPool -Name $ManagedMetadataServiceName -Account $ManagedMetaDataServiceAccount
write-host "App pool has been created successfully"
# create new managed meta data service application
$MetadataServiceApp = "Managed Meta Data Service"
New-SPMetadataServiceApplication -Name $MetadataServiceApp -ApplicationPool $saAppPoolName -DatabaseName "SPP_ManagedMetaData_DB"
write-host "Managed meta data service has been successfully created!"
Write-Host "Creating $MetadataServiceApp Application & Proxy..."
$MetadataServiceAppProxy = "Managed Meta Data Service Proxy"
New-SPMetadataServiceApplicationProxy -Name $MetadataServiceAppProxy -ServiceApplication $MetadataServiceApp
Write-Host $MetadataServiceAppProxy "has been successfully provisioned"
write-host "Done!!!!"
Remove-PSSnapin Microsoft.SharePoint.Powershell -EA 0

Provision SP 2010 - User Profile Application Service using PowerShell script

Following powershell script will provision UPA service.

Points to be noted:

1. Update $UserProfileServiceAccount with the account with respect to your environment.

2. Save the follwing script on some meaningful name like psProvisionUserProfileService.ps1

3. Call the file using bacth file & it contains follwoing and save as ProvisionUserProfileService.bat

cd /d %~dp0
powershell -noexit -file    ".\psProvisionUserProfileService.ps1" "%CD%"
pause


Add-PSSnapin Microsoft.SharePoint.Powershell -EA 0
$UserProfileServiceName ="UserProfileServiceAppPool"
$UserProfileServiceAccount = "xxxxxx"

$saAppPoolName = New-SPServiceApplicationPool -Name $UserProfileServiceName -Account $UserProfileServiceAccount

# UPA specifics
$upaInstanceName = "User Profile Service"
$upsInstanceName = "User Profile Synchronization Service"
$upaName = "User Profile Service"
$upaProfileDBName = "SP_User_Profile_DB"
$upaSocialDBName = "SP_User_Social_DB"
$upaSyncDBName = "SP_User_Sync_DB"
 

Write-Host "Creating $upaName Application & Proxy..."

$upa = New-SPProfileServiceApplication -Name $upaName -ApplicationPool $saAppPoolName -ProfileDBName $upaProfileDBName -SocialDBName $upaSocialDBName -ProfileSyncDBName $upaSyncDBName

New-SPProfileServiceApplicationProxy -Name "$upaName Proxy" -ServiceApplication $upa -DefaultProxyGroup

Write-Host "Starting the $upaInstanceName Instance..."

Get-SPServiceInstance | where-object {$_.TypeName -eq $upaInstanceName} | Start-SPServiceInstance

Write-Host " UPA Done!"

Remove-PSSnapin Microsoft.SharePoint.Powershell -EA 0
 

Sunday 7 April 2013

Managed Metadata Column Limitations - SP 2010

Hi All,
As everybody thinks that, SharePoint 2010 managed meta data column is very handy and useful for our all list operations and other SPD changes. However, following are limitations about Managed Meta Data column in SP 2010.
Briefly,
1) No InfoPath Support
2) No SharePoint Workspace Support
3) No Support in Office 2007
4) Cannot Edit Managed Metadata values in Datasheet Mode
5) Limitations in Views
6) Extra care required in SharePoint Designer Workflows
7) Feature deployment of Managed Metadata requires care
8 ) Cannot be used in calculated fields
9) Maximum of 250 terms selected per Managed Metadata Column
10) Caution when restoring a Local Term Set to another Content Database
11) Taxonomy feature is not activated on the Blank Site Template
12) Know capacity boundaries
13) Cannot add a Managed Metadata Column through SharePoint Designer
 
I referred following blog, and check below url for detailed explanation about each point mentioned from above list.
http://www.sharepointanalysthq.com/2011/06/managed-metadata-column-limitations/
 

Friday 5 April 2013

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

There are two ways to check/resolve the issue. Basically it's related to the SP PowerShell console being not run for your login account.
 
1. Actually this issue belongs -
PowerShell version being used/installed in SP environment. Generally for SP 2010 the version would be 2.0, however, if you install Windows Management Framework 3.0, which will install PowerShell version 3.0. So we have make sure that , our PowerShell should take 2.0 version.
No worries, it's easy to find and update the same.
To find which version, run following command in your SP PowerShell management console.
 
$version = $host | select version
$version.Version

 
If you receive something like below. If the Major version is not on 2, then you will get this runtime error.
Major Minor Build Revision
—– —– —– ——–
3 0 -1 -1

Which means that, you console is running with 3.0 versions. Relax, there is way to point to 2.0 version.

How?
a) Go back to the SharePoint 2010 Management Shell Shortcut, right click and select “Properties”
Under the Shortcut tab, Target: section, insert "-version 2
into the path. Make sure its before the -NoExit.
b) C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -version 2 -NoExit ” & ‘ C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ‘ “
c) Click apply, and then Ok.
d) Launch SP PowerShell console. That’s it.. Done.
 
Note: If this approach doesn't work, please follow point 2 below.
 
2. Check whether your login account had farm access or not by using following PowerShell command
Get-SPShellAdmin - if you get same error, it means that, you don't access to farm.
Then login with account which has full rights on farm and run following command to add the user.
Add-SPShellAdmin -username DOMAIN\userid
And also grant full rights on farm configuration db (generally SharePoint_Config, however, it may vary based on your org needs) & SharePoint admin content db.