Quantcast
Channel: SharePoint 2013 - Setup, Upgrade, Administration and Operations forum
Viewing all articles
Browse latest Browse all 21070

Exception thrown when using Get-SPEnterpriseSearchServiceApplication

$
0
0

Good day,

I'm trying to run the following code. All steps succeed when I execute them individually until I get to '$searchapp = Get-SPEnterpriseSearchServiceApplication -Identity "Search Service Application"'. I've checked the name of the service application and this line works just fine when I run it locally on the server.

Enable-PSRemoting -force
$remoteSession = New-PSSession -ComputerName "myServer"
Enter-PSSession $remoteSession
if ( (Get-PSSnapin -Name Microsoft.Sharepoint.Powershell -ErrorAction SilentlyContinue) -eq $null )
{
    Add-PsSnapin Microsoft.Sharepoint.Powershell
}
$searchapp = Get-SPEnterpriseSearchServiceApplication -Identity "Search Service Application"
$contentsources = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $searchapp | ForEach-Object{$_.StartFullCrawl()}
Exit-PSSession
Remove-PSSession $remoteSession

The following is the exception thrown:
Get-SPEnterpriseSearchServiceApplication : The type initializer for 'Microsoft.
Office.Server.Search.LocStringIdLookupTable' threw an exception.
At line:1 char:54
+ $searchapp = Get-SPEnterpriseSearchServiceApplication <<<<  -Identity "Search
 Service Application"
    + CategoryInfo          : InvalidData: (Microsoft.Offic...viceApplication:
   GetSearchServiceApplication) [Get-SPEnterpriseSearchServiceApplication], T 
  ypeInitializationException
    + FullyQualifiedErrorId : Microsoft.Office.Server.Search.Cmdlet.GetSearchS
   erviceApplication


Viewing all articles
Browse latest Browse all 21070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>