PoshCode Archive  Check-in [03a52b878e]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update SharePoint Search scopes, useful when revving the Scope definitions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:03a52b878e0ae6d1b66b31c8a1ad554c65d6acd5b82bfbeb181094cb2d92501e
User & Date: unknown 2018-06-10 14:26:55
Context
2018-06-10
14:26
This script serves three purposes, including the obvious: check-in: e77815af2e user: unknown tags: trunk
14:26
Update SharePoint Search scopes, useful when revving the Scope definitions. check-in: 03a52b878e user: unknown tags: trunk
14:26
Get detailed information on every CIFS share on a NetApp Filer. Function requires the NetApp Manage OnTap SDK 3.5. check-in: 522f915790 user: glnsize tags: trunk
Changes

Added Update-Scopes.ps1.























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# encoding: ascii
# api: powershell
# title: 
# description: Update SharePoint Search scopes, useful when revving the Scope definitions.
# version: 0.1
# type: function
# license: CC0
# function: Update-Scopes
# x-poshcode-id: 925
# x-archived: 2017-04-30T10:36:08
#
#
function Update-Scopes($siteUrl)
{
	[void][reflection.assembly]::Loadwithpartialname("Microsoft.SharePoint") | out-null
	[void][reflection.assembly]::Loadwithpartialname("Microsoft.office.server.search") | out-null
	
	$s = [microsoft.sharepoint.spsite]$siteUrl
	$sc = [microsoft.office.server.servercontext]::GetContext($s)
	$search = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($sc)
	$scopes = [microsoft.office.server.search.administration.scopes]$search
	$scopes.StartCompilation()
	while ($scopes.CompilationPercentComplete -lt 100) { sleep -seconds 3; write-host "$($scopes.CompilationPercentComplete)% complete" }
}

#usage: paste this text into your PowerShell window, then call the "Update-Scopes" function as noted below
Update-Scopes -siteUrl "http://dev/sites/MySPSite/"