Creating Content Source based on his content type using SharePoint PowerShell

October 19, 2011

Hi guys   Here's a way to create a content source based on his content type like   "SharePoint sites" or "Web Sites" etc...   if($myType -eq "Web"){ $webCS=$ssaContent.ContentSources.Create(, $contentSourceName); $webCS.startAddresses.Add($siteUrl); } if($myType -eq "SharePoint"){ $sharePointCS=$ssaContent.ContentSources.Create(, $contentSourceName); $sharePointCS.startAddresses.Add($siteUrl); } if($myType -eq "File"){ $fileCS=$ssaContent.ContentSources.Create(, $contentSourceName); $fileCS.startAddresses.Add($siteUrl);}   That's all Folks :)
one comment

Modify the scope name using SharePoint PowerShell

Hi guys,   Here's a simple example how to modify the scope's name using SharePoint 2010 Managment Shell   write-host聽 -f Yellow "modifing scope Name..." Get-SPEnterpriseSearchQueryScope -Identity "Scope Name" -SearchApplication聽"SSA Name"聽| Set-SPEnterpriseSearchQueryScope -Name聽"My聽New Scope Name"聽 -AlternateResultsPage http://sp2010/   write-host -f green聽 "Scope Name聽was successfully modified"   That's all Folks :)