-
Notifications
You must be signed in to change notification settings - Fork 16
/
ActivateOfficeWebApps.ps1
18 lines (16 loc) · 1.02 KB
/
ActivateOfficeWebApps.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$machinesToActivate = @("dev")
$serviceInstanceNames = @("Word Viewing Service", "PowerPoint Service", "Excel Calculation Services")
foreach ($machine in $machinesToActivate)
{
foreach ($serviceInstance in $serviceInstanceNames)
{
$serviceID = $(Get-SPServiceInstance | where {$_.TypeName -match $serviceInstance} | where {$_.Server -match "SPServer Name="+$machine}).ID
Start-SPServiceInstance -Identity $serviceID
}
}
$appPool = Get-SPServiceApplicationPool -Identity "SharePoint Web Services Default"
New-SPWordViewingServiceApplication -Name "WdView" -ApplicationPool $appPool | New-SPWordViewingServiceApplicationProxy -Name "WdProxy"
New-SPPowerPointServiceApplication -Name "PPT" -ApplicationPool $appPool | New-SPPowerPointServiceApplicationProxy -Name "PPTProxy"
New-SPExcelServiceApplication -Name "Excel" -ApplicationPool $appPool
$webAppsFeatureId = $(Get-SPFeature -limit all | where {$_.displayname -eq "OfficeWebApps"}).Id
Get-SPSite -limit ALL |foreach{Enable-SPFeature $webAppsFeatureId -url $_.URL }