公司的SharePoint 2013 farm, 裝備了Office Web App, 可以不用打開文件直接透過瀏覽器Preview.
但新安裝好的場遇到一個問題, 就是Excel文件都不能Preview, Mouse點下去只出現錯誤, 其他Word, PowerPoint, OneNote都能正確Preview
後來發覺是OWA不可以一開始就設定為View-only mode, 必須先以預設定「Edit and view」模式建立過一些文件, 然後才換成View-only.
設成Edit and view的PowerShell 如下:
順帶一提要用OWA來編輯文件, 需要購買相關License, 一般來說只要用戶有MS Office 2013的license就可以用了:
Office Web Apps licensing offers two options:
- View-only. By default, Office Web Apps is view-only. View-only functionality is provided for free.
- Edit and view. You’ll need to purchase an editing license to use the editing features of Office Web Apps with SharePoint 2013. You enable editing when you create the Office Web Apps Server farm.
If your organization licenses Office 2013 through a Volume Licensing program, you can enable Office Web Apps editing for SharePoint 2013 on-premises. This helps make sure that users have Office editing capabilities at home or in other locations where Office clients might not be installed. Editing licenses for Office Web Apps are not available for separate purchase.
For exact details about your license, refer to the Microsoft Software License Terms that is shown when you install Office Web Apps Server.
SharePoint 2013 provides new license enforcement that works with Office Web Apps. If you enable SharePoint licensing and then enable Office Web Apps editing, only the users who have the appropriate license can actually edit Office files in a browser. If no Office Web Apps editing licenses are applied for users, only viewing is supported.
For more information about how licensing works in SharePoint 2013, see Configure licensing in SharePoint Server 2013. The EditingEnabled parameter that enables editing is described in New-OfficeWebAppsFarm and Set-OfficeWebAppsFarm.
Files that are sent by the Share by link feature in SharePoint 2013 can be edited in Office Web Apps even when no editing license is present and when editing is disabled for the Office Web Apps Server farm.