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

2 comments: