SlideShare a Scribd company logo
1 of 6
#stsadm -o provisionservice -action start -servicetype
Microsoft.SharePoint.Administration.SPUserCodeService -servicename SPUserCodeV4
#. .parameters.ps1
function CreateIntegratedCatalogConnection
{
[CmdletBinding()]
[OutputType([string])]
param(
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName =
$true, HelpMessage = "Provide valid Catalog Url")]
[ValidatePattern("http(s*)://[a-zA-Z0-9-.]+.[a-zA-Z]{2,3}(s)?")]
[string]$catalogUrl,
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName =
$true, HelpMessage = "Provide valid SPSite Url")]
[ValidatePattern("http(s*)://[a-zA-Z0-9-.]+.[a-zA-Z]{2,3}(s)?")]
[string]$siteUrl,
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName =
$true, HelpMessage = "Provide valid TermSet Name")]
[string]$termSetName,
[Parameter(Mandatory = $false, ValueFromPipelineByPropertyName =
$false, HelpMessage = "Provide valid TermSet Name")]
[string]$rootTermName,
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName =
$true, HelpMessage = "Provide valid ManagedProperty Name")]
[string]$catalogTaxonomyManagedProperty
)
Begin
{
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction
SilentlyContinue
#. .parameters.ps1
try
{
$site = $null
$site = Get-SPSite $siteUrl -ErrorAction Stop
$mmsSession = $null
$mmsSession = New-Object
Microsoft.SharePoint.Taxonomy.TaxonomySession($site)
$termStore = $mmsSession.DefaultSiteCollectionTermStore
$termStore = $mmsSession.TermStores["Managed Metadata
Service"];
$siteGroupMarcos = $termStore.Groups["CriticALL Content
Types"];
$siteGroup = $termstore.GetSiteCollectionGroup($site)
$navigationTermSet = $siteGroup.TermSets[$termSetName.Trim()]
$navigationTermSetMarcos =
$siteGroupMarcos.TermSets["IntraContentType"]
# Create instance of catalog connection manager
$ccmanager = $null
$ccmanager = New-Object
Microsoft.SharePoint.Publishing.CatalogConnectionManager($site)
}
catch
{
$FailedItem = $_.Exception.ItemName
$ErrorMessage = $_.Exception.Message
Write-Output $FailedItem $ErrorMessage
Break
}
}
Process
{
$sourceTermMarcos = $navigationTermSetMarcos.GetAllTerms()
##$rootNavigationTerm = $navigationTermSet.GetAllTerms() | ?
{ $_.Name -eq $rootTermName.Trim() }
$rootNavigationTermMarcos = $navigationTermSetMarcos.GetAllTerms() |
?{ $_.Name -eq $rootTermName.Trim() }
Write-Output "Added Catalog
Connection:"$rootNavigationTermMarcos.Name
if ($rootNavigationTermMarcos)
{
$catalogSettings =
[Microsoft.SharePoint.Publishing.PublishingCatalogUtility]::GetPublishingCatalog
($site, $catalogUrl)
if (-not [string]::
IsNullOrEmpty($catalogSettings.CatalogName))
{
$catalogSettings.ConnectedWebServerRelativeUrl =
"/publishing"
$catalogSettings.RewriteCatalogItemUrls = $true #rewrite
the urls of the Product Items to match our term driven navigation if set to
true, if this isnt set to true we will get the full url to the item in the
content site where the Product Item is located
$catalogSettings.ConnectedWebId = $site.RootWeb.ID # id
of the web site where our Site Navigation Group resides
$catalogSettings.CatalogItemUrlRewriteTemplate = "/
[Title]" # how we want the end of the url to be displayed, in this case it is
the title of the navigation term
$catalogSettings.CatalogTaxonomyManagedProperty =
$catalogTaxonomyManagedProperty # name of the managedproperty associated with
our catalog.
$catalogSettings.CatalogNavigationTerm =
$rootNavigationTermMarcos.Id # id of our root navigation term
#$catalogSettings.IsReusedWithPinning=$True
try
{
#$ccmanager.UpdateCatalogConnection($catalogSettings)
#$ccmanager.update()
$ccmanager.AddCatalogConnection($catalogSettings)
$ccmanager.update()
Write-Output "Added Catalog
Connection:"$catalogSettings.CatalogName
Write-Output "Added Catalog
Connection:"$catalogSettings.CatalogNavigationTerm
}
catch
{
$FailedItem = $_.Exception.ItemName
$ErrorMessage = $_.Exception.Message
Write-Output "Could not connect to
catalog:"$FailedItem $ErrorMessage -ErrorAction Continue
}
}
}
}
End
{
$site.Dispose()
}
}
CreateIntegratedCatalogConnection
"http://wingtipserver:8090/authoring/Lists/Events"
"http://wingtipserver:8090/publishing" "Site Navigation" "Events"
"owstaxidIntraContentType"
<#
function PinTermToNavigation
{
[CmdletBinding()]
[OutputType([string])]
param (
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName =
$true, HelpMessage = "Provide valid Catalog Url")]
[ValidatePattern("http(s*)://[a-zA-Z0-9-.]+.[a-zA-Z]{2,3}(s)?")]
[string]$sourceSiteUrl,
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName =
$true, HelpMessage = "Provide valid SPSite Url")]
[ValidatePattern("http(s*)://[a-zA-Z0-9-.]+.[a-zA-Z]{2,3}(s)?")]
[string]$targetSiteUrl,
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName =
$true, HelpMessage = "Provide valid Term Name")]
[string]$sourceTermName,
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName =
$true, HelpMessage = "Provide valid Term Name")]
[string]$targetTermName,
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName =
$true, HelpMessage = "Provide valid TermSet Name")]
[string]$sourceTermSetName,
[Parameter(Mandatory = $true, ValueFromPipelineByPropertyName =
$true, HelpMessage = "Provide valid TermSet Name")]
[string]$targetTermSetName
)
Begin
{
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction
SilentlyContinue
try
{
$sourceSite = $null
$targetSite = $null
$sourceSite = new-object
Microsoft.SharePoint.SPSite($sourceSiteUrl)
$targetSite = Get-SPSite $targetSiteUrl -ErrorAction Stop
$mmsSession = $null
$mmsSession = New-Object
Microsoft.SharePoint.Taxonomy.TaxonomySession($sourceSite,$true)
#$termStore = $mmsSession.DefaultSiteCollectionTermStore
$termStore = $mmsSession.TermStores["Managed Metadata
Service"];
}
catch
{
$FailedItem = $_.Exception.ItemName
$ErrorMessage = $_.Exception.Message
Write-Output $FailedItem $ErrorMessage
Break
}
}
Process
{
$termGroupMarcos = $termStore.Groups["CriticALL Content Types"];
$sourceSiteGroup = $termstore.GetSiteCollectionGroup($sourceSite)
$targetSiteGroup = $termstore.GetSiteCollectionGroup($targetSite)
if ($sourceSiteGroup -ne $null -and $targetSiteGroup -ne $null)
{
$termSet = $termGroupMarcos.TermSets["IntraContentType"];
$sourceTermSet =
$termGroupMarcos.TermSets[$sourceTermSetName.Trim()]
$targetTermSet =
$targetSiteGroup.TermSets[$targetTermSetName.Trim()]
$sourceTermMarcos = $termSet.GetAllTerms()
$sourceTerm = $termSet.GetAllTerms() | ?{ $_.Name -eq
$sourceTermName.Trim() }
$targetTerm = $targetTermSet.GetAllTerms() | ?{ $_.Name -eq
$targetTermName.Trim() }
if ($sourceTerm -ne $null -and $targetTerm -ne $null)
{
try
{
$targetTerm.ReuseTermWithPinning($sourceTerm)
$termStore.CommitAll()
Write-Output "Pinning Term:"$sourceTerm.Name "to
Term:"$targetTerm.Name
}
catch
{
$FailedItem = $_.Exception.ItemName
$ErrorMessage = $_.Exception.Message
Write-Output $FailedItem $ErrorMessage
Break
}
}
}
}
End
{
$sourceSite.Dispose()
$targetSite.Dispose()
}
}
. .parameters.ps1
$sourceSiteUrl = "http://wingtipserver:8090/authoring"
$targetSiteUrl = "http://wingtipserver:8090/publishing"
PinTermToNavigation $sourceSiteUrl $targetSiteUrl "Article" "Article"
"IntraContentType" "Site Navigation"
#>
}
}
. .parameters.ps1
$sourceSiteUrl = "http://wingtipserver:8090/authoring"
$targetSiteUrl = "http://wingtipserver:8090/publishing"
PinTermToNavigation $sourceSiteUrl $targetSiteUrl "Article" "Article"
"IntraContentType" "Site Navigation"
#>

More Related Content

What's hot

CakePHPをさらにDRYにする、ドライケーキレシピ akiyan.com 秋田真宏
CakePHPをさらにDRYにする、ドライケーキレシピ akiyan.com 秋田真宏CakePHPをさらにDRYにする、ドライケーキレシピ akiyan.com 秋田真宏
CakePHPをさらにDRYにする、ドライケーキレシピ akiyan.com 秋田真宏
Masahiro Akita
 
jQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a TreejQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a Tree
adamlogic
 
Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)
Leonardo Soto
 
Coffeescript a z
Coffeescript a zCoffeescript a z
Coffeescript a z
Starbuildr
 
Jython: Python para la plataforma Java (JRSL 09)
Jython: Python para la plataforma Java (JRSL 09)Jython: Python para la plataforma Java (JRSL 09)
Jython: Python para la plataforma Java (JRSL 09)
Leonardo Soto
 
An introduction to property-based testing
An introduction to property-based testingAn introduction to property-based testing
An introduction to property-based testing
Vincent Pradeilles
 
ABV_fastcontact
ABV_fastcontactABV_fastcontact
ABV_fastcontact
arjun rao
 

What's hot (20)

Database performance 101
Database performance 101Database performance 101
Database performance 101
 
CakePHPをさらにDRYにする、ドライケーキレシピ akiyan.com 秋田真宏
CakePHPをさらにDRYにする、ドライケーキレシピ akiyan.com 秋田真宏CakePHPをさらにDRYにする、ドライケーキレシピ akiyan.com 秋田真宏
CakePHPをさらにDRYにする、ドライケーキレシピ akiyan.com 秋田真宏
 
jQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a TreejQuery and Rails, Sitting in a Tree
jQuery and Rails, Sitting in a Tree
 
Developing applications for performance
Developing applications for performanceDeveloping applications for performance
Developing applications for performance
 
50 Laravel Tricks in 50 Minutes
50 Laravel Tricks in 50 Minutes50 Laravel Tricks in 50 Minutes
50 Laravel Tricks in 50 Minutes
 
Database Design Patterns
Database Design PatternsDatabase Design Patterns
Database Design Patterns
 
Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)
 
Coffeescript a z
Coffeescript a zCoffeescript a z
Coffeescript a z
 
The History of PHPersistence
The History of PHPersistenceThe History of PHPersistence
The History of PHPersistence
 
Internationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsInternationalizing CakePHP Applications
Internationalizing CakePHP Applications
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBenelux
 
Jython: Python para la plataforma Java (JRSL 09)
Jython: Python para la plataforma Java (JRSL 09)Jython: Python para la plataforma Java (JRSL 09)
Jython: Python para la plataforma Java (JRSL 09)
 
An introduction to property-based testing
An introduction to property-based testingAn introduction to property-based testing
An introduction to property-based testing
 
Agile database access with CakePHP 3
Agile database access with CakePHP 3Agile database access with CakePHP 3
Agile database access with CakePHP 3
 
Intoduction to php restful web service
Intoduction to php  restful web serviceIntoduction to php  restful web service
Intoduction to php restful web service
 
Indeed My Jobs: A case study in ReactJS and Redux (Meetup talk March 2016)
Indeed My Jobs: A case study in ReactJS and Redux (Meetup talk March 2016)Indeed My Jobs: A case study in ReactJS and Redux (Meetup talk March 2016)
Indeed My Jobs: A case study in ReactJS and Redux (Meetup talk March 2016)
 
Async all around us (promises)
Async all around us (promises)Async all around us (promises)
Async all around us (promises)
 
Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technology
 
ABV_fastcontact
ABV_fastcontactABV_fastcontact
ABV_fastcontact
 
Python Ireland Nov 2010 Talk: Unit Testing
Python Ireland Nov 2010 Talk: Unit TestingPython Ireland Nov 2010 Talk: Unit Testing
Python Ireland Nov 2010 Talk: Unit Testing
 

Viewers also liked

4 культ и_искусс_власова_2015_укр
4 культ и_искусс_власова_2015_укр4 культ и_искусс_власова_2015_укр
4 культ и_искусс_власова_2015_укр
Aira_Roo
 
Hospital Management Systems
Hospital Management SystemsHospital Management Systems
Hospital Management Systems
Ali Sultan
 
theonlilife.com-Onli Beverages Mid-Century Magic
theonlilife.com-Onli Beverages Mid-Century Magictheonlilife.com-Onli Beverages Mid-Century Magic
theonlilife.com-Onli Beverages Mid-Century Magic
Lauren Driscoll
 

Viewers also liked (16)

Innovation Blueprints Magazine issue #102
Innovation Blueprints Magazine issue #102Innovation Blueprints Magazine issue #102
Innovation Blueprints Magazine issue #102
 
¿Médicos o robots?. La medicina que viene", Ignacio Riesgo
¿Médicos o robots?. La medicina que viene", Ignacio Riesgo¿Médicos o robots?. La medicina que viene", Ignacio Riesgo
¿Médicos o robots?. La medicina que viene", Ignacio Riesgo
 
Terceirona artilharia
Terceirona   artilhariaTerceirona   artilharia
Terceirona artilharia
 
Trendy Directories : Countdown Has Begun ?
Trendy Directories : Countdown Has Begun ?Trendy Directories : Countdown Has Begun ?
Trendy Directories : Countdown Has Begun ?
 
4 культ и_искусс_власова_2015_укр
4 культ и_искусс_власова_2015_укр4 культ и_искусс_власова_2015_укр
4 культ и_искусс_власова_2015_укр
 
Chemistry paper solution
Chemistry paper solutionChemistry paper solution
Chemistry paper solution
 
4 англ худик_2015_укр
4 англ худик_2015_укр4 англ худик_2015_укр
4 англ худик_2015_укр
 
sistem regulasi manusia
sistem regulasi manusiasistem regulasi manusia
sistem regulasi manusia
 
Actividad dictados
Actividad dictadosActividad dictados
Actividad dictados
 
Hospital Management Systems
Hospital Management SystemsHospital Management Systems
Hospital Management Systems
 
Speed Up Your Development Process and Boost Accuracy with Abstract
Speed Up Your Development Process and Boost Accuracy with AbstractSpeed Up Your Development Process and Boost Accuracy with Abstract
Speed Up Your Development Process and Boost Accuracy with Abstract
 
Gerencia estratégica del conocimiento en el aula
Gerencia estratégica del conocimiento en el aulaGerencia estratégica del conocimiento en el aula
Gerencia estratégica del conocimiento en el aula
 
NHS_White_Paper_TOD_2015
NHS_White_Paper_TOD_2015NHS_White_Paper_TOD_2015
NHS_White_Paper_TOD_2015
 
Ikeph9 2014-1112
Ikeph9 2014-1112Ikeph9 2014-1112
Ikeph9 2014-1112
 
theonlilife.com-Onli Beverages Mid-Century Magic
theonlilife.com-Onli Beverages Mid-Century Magictheonlilife.com-Onli Beverages Mid-Century Magic
theonlilife.com-Onli Beverages Mid-Century Magic
 
Fuerzas II
Fuerzas IIFuerzas II
Fuerzas II
 

Similar to Manage catalog Configueation In Sharepoint PowerShell

VPN Access Runbook
VPN Access RunbookVPN Access Runbook
VPN Access Runbook
Taha Shakeel
 
Анатолий Поляков - Drupal.ajax framework from a to z
Анатолий Поляков - Drupal.ajax framework from a to zАнатолий Поляков - Drupal.ajax framework from a to z
Анатолий Поляков - Drupal.ajax framework from a to z
LEDC 2016
 
Propel sfugmd
Propel sfugmdPropel sfugmd
Propel sfugmd
iKlaus
 

Similar to Manage catalog Configueation In Sharepoint PowerShell (20)

[PHPCon 2023] “Kto to pisał?!... a, to ja.”, czyli sposoby żeby znienawidzić ...
[PHPCon 2023] “Kto to pisał?!... a, to ja.”, czyli sposoby żeby znienawidzić ...[PHPCon 2023] “Kto to pisał?!... a, to ja.”, czyli sposoby żeby znienawidzić ...
[PHPCon 2023] “Kto to pisał?!... a, to ja.”, czyli sposoby żeby znienawidzić ...
 
Zero to SOLID
Zero to SOLIDZero to SOLID
Zero to SOLID
 
Aplicacoes dinamicas Rails com Backbone
Aplicacoes dinamicas Rails com BackboneAplicacoes dinamicas Rails com Backbone
Aplicacoes dinamicas Rails com Backbone
 
VPN Access Runbook
VPN Access RunbookVPN Access Runbook
VPN Access Runbook
 
The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202The Ring programming language version 1.8 book - Part 50 of 202
The Ring programming language version 1.8 book - Part 50 of 202
 
XQuery Rocks
XQuery RocksXQuery Rocks
XQuery Rocks
 
The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185
 
laravel tricks in 50minutes
laravel tricks in 50minuteslaravel tricks in 50minutes
laravel tricks in 50minutes
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
The Ring programming language version 1.5.3 book - Part 44 of 184
The Ring programming language version 1.5.3 book - Part 44 of 184The Ring programming language version 1.5.3 book - Part 44 of 184
The Ring programming language version 1.5.3 book - Part 44 of 184
 
The Ring programming language version 1.5.3 book - Part 54 of 184
The Ring programming language version 1.5.3 book - Part 54 of 184The Ring programming language version 1.5.3 book - Part 54 of 184
The Ring programming language version 1.5.3 book - Part 54 of 184
 
G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門
 
"Kto to pisał?!... A, to ja.", czyli sposoby, żeby znienawidzić siebie z prze...
"Kto to pisał?!... A, to ja.", czyli sposoby, żeby znienawidzić siebie z prze..."Kto to pisał?!... A, to ja.", czyli sposoby, żeby znienawidzić siebie z prze...
"Kto to pisał?!... A, to ja.", czyli sposoby, żeby znienawidzić siebie z prze...
 
Анатолий Поляков - Drupal.ajax framework from a to z
Анатолий Поляков - Drupal.ajax framework from a to zАнатолий Поляков - Drupal.ajax framework from a to z
Анатолий Поляков - Drupal.ajax framework from a to z
 
Min-Maxing Software Costs
Min-Maxing Software CostsMin-Maxing Software Costs
Min-Maxing Software Costs
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
 
The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189
 
Propel sfugmd
Propel sfugmdPropel sfugmd
Propel sfugmd
 
WooCommerce CRUD and Data Store by Akeda Bagus
WooCommerce CRUD and Data Store by Akeda BagusWooCommerce CRUD and Data Store by Akeda Bagus
WooCommerce CRUD and Data Store by Akeda Bagus
 
The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212The Ring programming language version 1.10 book - Part 54 of 212
The Ring programming language version 1.10 book - Part 54 of 212
 

Recently uploaded

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Recently uploaded (20)

WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 

Manage catalog Configueation In Sharepoint PowerShell

  • 1. #stsadm -o provisionservice -action start -servicetype Microsoft.SharePoint.Administration.SPUserCodeService -servicename SPUserCodeV4 #. .parameters.ps1 function CreateIntegratedCatalogConnection { [CmdletBinding()] [OutputType([string])] param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "Provide valid Catalog Url")] [ValidatePattern("http(s*)://[a-zA-Z0-9-.]+.[a-zA-Z]{2,3}(s)?")] [string]$catalogUrl, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "Provide valid SPSite Url")] [ValidatePattern("http(s*)://[a-zA-Z0-9-.]+.[a-zA-Z]{2,3}(s)?")] [string]$siteUrl, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "Provide valid TermSet Name")] [string]$termSetName, [Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $false, HelpMessage = "Provide valid TermSet Name")] [string]$rootTermName, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "Provide valid ManagedProperty Name")] [string]$catalogTaxonomyManagedProperty ) Begin { Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #. .parameters.ps1 try { $site = $null $site = Get-SPSite $siteUrl -ErrorAction Stop $mmsSession = $null $mmsSession = New-Object Microsoft.SharePoint.Taxonomy.TaxonomySession($site) $termStore = $mmsSession.DefaultSiteCollectionTermStore $termStore = $mmsSession.TermStores["Managed Metadata Service"]; $siteGroupMarcos = $termStore.Groups["CriticALL Content Types"]; $siteGroup = $termstore.GetSiteCollectionGroup($site) $navigationTermSet = $siteGroup.TermSets[$termSetName.Trim()] $navigationTermSetMarcos = $siteGroupMarcos.TermSets["IntraContentType"] # Create instance of catalog connection manager $ccmanager = $null $ccmanager = New-Object Microsoft.SharePoint.Publishing.CatalogConnectionManager($site)
  • 2. } catch { $FailedItem = $_.Exception.ItemName $ErrorMessage = $_.Exception.Message Write-Output $FailedItem $ErrorMessage Break } } Process { $sourceTermMarcos = $navigationTermSetMarcos.GetAllTerms() ##$rootNavigationTerm = $navigationTermSet.GetAllTerms() | ? { $_.Name -eq $rootTermName.Trim() } $rootNavigationTermMarcos = $navigationTermSetMarcos.GetAllTerms() | ?{ $_.Name -eq $rootTermName.Trim() } Write-Output "Added Catalog Connection:"$rootNavigationTermMarcos.Name if ($rootNavigationTermMarcos) { $catalogSettings = [Microsoft.SharePoint.Publishing.PublishingCatalogUtility]::GetPublishingCatalog ($site, $catalogUrl) if (-not [string]:: IsNullOrEmpty($catalogSettings.CatalogName)) { $catalogSettings.ConnectedWebServerRelativeUrl = "/publishing" $catalogSettings.RewriteCatalogItemUrls = $true #rewrite the urls of the Product Items to match our term driven navigation if set to true, if this isnt set to true we will get the full url to the item in the content site where the Product Item is located $catalogSettings.ConnectedWebId = $site.RootWeb.ID # id of the web site where our Site Navigation Group resides $catalogSettings.CatalogItemUrlRewriteTemplate = "/ [Title]" # how we want the end of the url to be displayed, in this case it is the title of the navigation term $catalogSettings.CatalogTaxonomyManagedProperty = $catalogTaxonomyManagedProperty # name of the managedproperty associated with our catalog. $catalogSettings.CatalogNavigationTerm = $rootNavigationTermMarcos.Id # id of our root navigation term #$catalogSettings.IsReusedWithPinning=$True try { #$ccmanager.UpdateCatalogConnection($catalogSettings) #$ccmanager.update() $ccmanager.AddCatalogConnection($catalogSettings) $ccmanager.update() Write-Output "Added Catalog Connection:"$catalogSettings.CatalogName Write-Output "Added Catalog Connection:"$catalogSettings.CatalogNavigationTerm } catch {
  • 3. $FailedItem = $_.Exception.ItemName $ErrorMessage = $_.Exception.Message Write-Output "Could not connect to catalog:"$FailedItem $ErrorMessage -ErrorAction Continue } } } } End { $site.Dispose() } } CreateIntegratedCatalogConnection "http://wingtipserver:8090/authoring/Lists/Events" "http://wingtipserver:8090/publishing" "Site Navigation" "Events" "owstaxidIntraContentType" <# function PinTermToNavigation { [CmdletBinding()] [OutputType([string])] param ( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "Provide valid Catalog Url")] [ValidatePattern("http(s*)://[a-zA-Z0-9-.]+.[a-zA-Z]{2,3}(s)?")] [string]$sourceSiteUrl, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "Provide valid SPSite Url")] [ValidatePattern("http(s*)://[a-zA-Z0-9-.]+.[a-zA-Z]{2,3}(s)?")] [string]$targetSiteUrl, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "Provide valid Term Name")] [string]$sourceTermName, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "Provide valid Term Name")] [string]$targetTermName, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "Provide valid TermSet Name")] [string]$sourceTermSetName, [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "Provide valid TermSet Name")] [string]$targetTermSetName ) Begin { Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue try { $sourceSite = $null $targetSite = $null $sourceSite = new-object Microsoft.SharePoint.SPSite($sourceSiteUrl)
  • 4. $targetSite = Get-SPSite $targetSiteUrl -ErrorAction Stop $mmsSession = $null $mmsSession = New-Object Microsoft.SharePoint.Taxonomy.TaxonomySession($sourceSite,$true) #$termStore = $mmsSession.DefaultSiteCollectionTermStore $termStore = $mmsSession.TermStores["Managed Metadata Service"]; } catch { $FailedItem = $_.Exception.ItemName $ErrorMessage = $_.Exception.Message Write-Output $FailedItem $ErrorMessage Break } } Process { $termGroupMarcos = $termStore.Groups["CriticALL Content Types"]; $sourceSiteGroup = $termstore.GetSiteCollectionGroup($sourceSite) $targetSiteGroup = $termstore.GetSiteCollectionGroup($targetSite) if ($sourceSiteGroup -ne $null -and $targetSiteGroup -ne $null) { $termSet = $termGroupMarcos.TermSets["IntraContentType"]; $sourceTermSet = $termGroupMarcos.TermSets[$sourceTermSetName.Trim()] $targetTermSet = $targetSiteGroup.TermSets[$targetTermSetName.Trim()] $sourceTermMarcos = $termSet.GetAllTerms() $sourceTerm = $termSet.GetAllTerms() | ?{ $_.Name -eq $sourceTermName.Trim() } $targetTerm = $targetTermSet.GetAllTerms() | ?{ $_.Name -eq $targetTermName.Trim() } if ($sourceTerm -ne $null -and $targetTerm -ne $null) { try { $targetTerm.ReuseTermWithPinning($sourceTerm) $termStore.CommitAll() Write-Output "Pinning Term:"$sourceTerm.Name "to Term:"$targetTerm.Name } catch { $FailedItem = $_.Exception.ItemName $ErrorMessage = $_.Exception.Message Write-Output $FailedItem $ErrorMessage Break } } } } End { $sourceSite.Dispose() $targetSite.Dispose()
  • 5. } } . .parameters.ps1 $sourceSiteUrl = "http://wingtipserver:8090/authoring" $targetSiteUrl = "http://wingtipserver:8090/publishing" PinTermToNavigation $sourceSiteUrl $targetSiteUrl "Article" "Article" "IntraContentType" "Site Navigation" #>
  • 6. } } . .parameters.ps1 $sourceSiteUrl = "http://wingtipserver:8090/authoring" $targetSiteUrl = "http://wingtipserver:8090/publishing" PinTermToNavigation $sourceSiteUrl $targetSiteUrl "Article" "Article" "IntraContentType" "Site Navigation" #>