-
Notifications
You must be signed in to change notification settings - Fork 1
/
Add-DistCache.ps1
54 lines (36 loc) · 1.01 KB
/
Add-DistCache.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<#
.SYNOPSIS
Adds host to cache cluster
.DESCRIPTION
Used as part of 2013 topology builder
Also used when dealing with changing DC service indentity
spence@harbar.net
25/06/2015
.NOTES
File Name : Add-DistCache.ps1
Author : Spencer Harbar (spence@harbar.net)
Requires : PowerShell Version 2.0
.LINK
.PARAMETER File
The configuration file
#>
#region PARAMS
param (
[String]$server
)
#endregion PARAMS
#region MAIN
try {
Add-PSSnapin Microsoft.SharePoint.PowerShell
Write-Host "$(Get-Date -Format T) : Adding server $server as Distributed Cache host..."
Write-Host "$(Get-Date -Format T) : This normally takes about 2 minutes..." -ForegroundColor Yellow
Add-SPDistributedCacheServiceInstance
Write-Host "$(Get-Date -Format T) : Added Distributed Cache host!" -ForegroundColor Green
}
catch {
Write-Host "OOOPS! We barfed during adding cache host cluster on $server." -ForegroundColor Red
$_
Exit
}
#endregion MAIN
#EOF