spjeff / spbestwarmup

Tired of waiting for SharePoint pages to load? Want something easy to support? That works on all versions? This warmup script is for you!
2 stars 0 forks source link

WOPI loop - exceptions #18

Closed bkuppens closed 7 years ago

bkuppens commented 7 years ago

The code for iterating over the wopi bindings contains some errors which causes exceptions:

$wopis = Get-SPWOPIBinding | Select-Object ServerName -Unique foreach ($w in $wopis) { foreach ($r in $remoteuis) { NavigateTo "http://$w/$r/RemoteUIs.ashx" NavigateTo "https://$w/$r/RemoteUIs.ashx" } foreach ($s in $services) { NavigateTo "http://$w"+":809/$s/" NavigateTo "https://$w"+":810/$s/" } }

spjeff commented 7 years ago

Thanks! Correct code.

https://github.com/spjeff/spbestwarmup/commit/eae53c79882a583e4f3b9e8a502cb73b7f86f95d#diff-316afa53af12494556ef094f27de1d72

FlorentCHAUVIN commented 6 years ago

Hello, there always error on this code (Error on service url and no writelog for this section), could you modify code like this:

Write-Output "Opening Office Online Server (OOS)..."
$remoteuis = "m,o,oh,op,p,we,wv,x".Split(",")
$services = "diskcache/DiskCache.svc,dss/DocumentSessionService.svc,ecs/ExcelService.asmx,farmstatemanager/FarmStateManager.svc,metb/BroadcastStateService.svc,pptc/Viewing.svc,ppte/Editing.svch,wdss/WordDocumentSessionService.svc,wess/WordSaveService.svc,wvc/Conversion.svc".Split(",")

# Loop per WOPI
$wopis = Get-SPWOPIBinding | Select-Object ServerName -Unique
foreach ($w in $wopis.ServerName) {
    foreach ($r in $remoteuis) {
        NavigateTo "http://$w/$r/RemoteUIs.ashx"
        NavigateTo "https://$w/$r/RemoteUIs.ashx"
    }
    foreach ($s in $services) {
        NavigateTo ("http://$w"+":809/$s")
        NavigateTo ("https://$w"+":810/$s")
    }
}