Showing posts with label FAST Search. Show all posts
Showing posts with label FAST Search. Show all posts

Thursday, January 11, 2018

Renew FAST Search Certificate using PowerShell

This script is more useful for the environments that uses self signed certificates for FAST Search


###################################
# Apply Certificate to FAST
###################################

Clear
Remove-PSSnapin AdminSnapIn -ErrorAction SilentlyContinue
Remove-PSSnapin Microsoft.FASTSearch.PowerShell -ErrorAction SilentlyContinue
Remove-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$userName = "Domain\ServiceAccountName"
$FastContentServiceName = "FAST Content"

write-host "Applying Certificate to FAST" -ForegroundColor Green
#Release worker processess with IISRESET
iisreset

stop-service FAST*

$installerdir = $env:FASTSEARCH + "installer\scripts"
echo $installerdir
cd $installerdir
$pw = ConvertTo-SecureString -AsPlainText -force test
.\ReplaceDefaultCertificate.ps1 -generateNewCertificate $true -certificatePassword $pw
$cert = @(dir cert:\LocalMachine\My -recurse | ? { $_.Subject -eq 'CN=FASTSearchCert' })[0]
$thumb = $cert.Thumbprint

Start-service FAST*

.\SecureFASTSearchConnector.ps1 -certThumbprint $thumb -ssaName $FastContentServiceName -username $userName

Thursday, November 12, 2015

Renew FAST Search Certificate in SharePoint 2010 - PowerShell Script

Requirement: Renew  or associate a certificate (self signed) for FAST Search - SharePoint 2010. In development environment, the FAST Search certificates usually expire every year.

Solution: Automate the renewal of certificate through a PowerShell script

PowerShell Script:

-------------------------------------------------------------------------------------------------------------------------
###################################
# Apply Certificate to FAST
###################################

Clear
Remove-PSSnapin AdminSnapIn -ErrorAction SilentlyContinue
Remove-PSSnapin Microsoft.FASTSearch.PowerShell -ErrorAction SilentlyContinue
Remove-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

Add-PSSnapin AdminSnapIn
Add-PSSnapin Microsoft.FASTSearch.PowerShell
Add-PSSnapin Microsoft.SharePoint.PowerShell

write-host "Applying Certificate to FAST" -ForegroundColor Green
#Release worker processess with IISRESET
iisreset

stop-service FAST*

$installerdir = $env:FASTSEARCH + "installer\scripts"
echo $installerdir
cd $installerdir
$pw = ConvertTo-SecureString -AsPlainText -force test
.\ReplaceDefaultCertificate.ps1 -generateNewCertificate $true -certificatePassword $pw
$cert = @(dir cert:\LocalMachine\My -recurse | ? { $_.Subject -eq 'CN=FASTSearchCert' })[0]
$thumb = $cert.Thumbprint

Start-service FAST*

.\SecureFASTSearchConnector.ps1 -certThumbprint $thumb -ssaName "FAST Content" -username "domain\spfastserviceaccount"


-------------------------------------------------------------------------------------------------------------------------


PowerShell Script for adding FAST Search Crawl Rules in SharePoint 2010

Requirement: Define and add FAST Search crawl rules in SHarePoint 2010 through a PowerShell Script

Script:

                                                                                                                                                               

clear
Remove-PSSnapin Microsoft.FASTSearch.Powershell -ErrorAction SilentlyContinue
Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
Add-PSSnapin Microsoft.FASTSearch.Powershell
Add-PSSnapin Microsoft.SharePoint.Powershell


##### Variables ####

$WebApplciationUrl = "http://webapplication"


#Exclusion Rules
$exRule1 = $WebApplciationUrl + "/*/Forms"
$exRule2 = $WebApplciationUrl + "/*.*.aspx(){1}"


#Inclusion Rules
$inRule1 = $WebApplciationUrl + "/sites/Project Deposit/_layouts/*.*(((records))|(Records))/.*"
$inRule2 = $WebApplciationUrl + "/sites/Project Deposit//*.*/((records)|(Records))(/)*.*"



$excludeRules = $exRule1,$exRule2
$includeRules = $inRule1,$inRule2


#Get Search service Application
$SearchServiceApp = Get-SPenterpriseSearchServiceApplication "FAST Content"
echo $SearchServiceApp

#Create Exclusion Crawl Rules
foreach($exItem in $excludeRules)
{
    New-SPEnterpriseSearchCrawlRule -SearchApplication $SearchServiceApp -Path $exItem -Type ExclusionRule -IsAdvancedRegularExpression $true ## -CrawlAsHttp 1
    write-host "Succesfully added exclusive rule: $exItem"
}

#Create Inclusion Crawl Rules
foreach($inItem in $includeRules)
{
    New-SPEnterpriseSearchCrawlRule -SearchApplication $SearchServiceApp -Path $inItem -Type InclusionRule -IsAdvancedRegularExpression $true
    write-host "Succesfully added inclusive rule: $inItem"
}


                                                                                                                                                               

Access to XMLHttpRequest at 'from origin has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. .net core angular

Issue: The angular application was getting error from API that the origin has been blocked by CORS policy. Solution: Make sure that the...