Set-SPExcelFileLocation

設定 Excel Services 應用程式受信任檔案位置的屬性。

Syntax

Set-SPExcelFileLocation
   [-Identity] <SPExcelFileLocationPipeBind>
   -ExcelServiceApplication <SPExcelServiceApplicationPipeBind>
   [-AbortOnRefreshOnOpenFail]
   [-Address <String>]
   [-AssignmentCollection <SPAssignmentCollection>]
   [-AutomaticVolatileFunctionCacheLifetime <Int32>]
   [-ChartAndImageSizeMax <Int32>]
   [-ConcurrentDataRequestsPerSessionMax <Int32>]
   [-Confirm]
   [-DefaultWorkbookCalcMode <DefaultWorkbookCalcMode>]
   [-Description <String>]
   [-DisplayGranularExtDataErrors]
   [-ExternalDataAllowed <AllowExternalData>]
   [-IncludeChildren]
   [-LocationType <LocationType>]
   [-ManualExtDataCacheLifetime <Int32>]
   [-NewWorkbookSessionTimeout <Int32>]
   [-PeriodicExtDataCacheLifetime <Int32>]
   [-RequestDurationMax <Int32>]
   [-RESTExternalDataAllowed]
   [-SessionTimeout <Int32>]
   [-ShortSessionTimeout <Int32>]
   [-UdfsAllowed]
   [-WarnOnDataRefresh]
   [-WhatIf]
   [-WorkbookSizeMax <Int32>]
   [-ChartRenderDurationMax <Int32>]
   [<CommonParameters>]

Description

Set-SPExcelFileLocation Cmdlet 會設定 Excel Services 應用程式載入活頁簿的位置屬性。 Excel Services 應用程式只會載入儲存在受信任檔案位置的活頁簿。 受信任檔案位置的屬性可控制在 Excel Services 應用程式載入時使用活頁簿的方式。 Excel Services 應用程式一直強制執行由載入活頁簿之受信任檔案位置所定義的屬性。 受信任檔案位置所使用的屬性是透過比較活頁簿的檔案路徑與受信任檔案位置的 Address 參數來判斷。

如需 SharePoint 產品和技術的 Windows PowerShell 權限及最新資訊,請參閱線上文件 SharePoint Server Cmdlet

範例

--------------範例 1--------------

Get-SPExcelFileLocation -ExcelServiceApplication "My Excel Service" | where { $_.externaldataallowed -eq "DclAndEmbedded"} | Set-SPExcelFileLocation -ExernalDataAllowed Dcl

此範例會取得允許從活頁簿檔案載入資料連線,且名為 My Excel Service 之 Excel Services 應用程式 Web 服務應用程式的每一個受信任檔案位置,並會指定位置必須使用資料連線庫來載入資料連線。

--------------範例 2--------------

Get-SPExcelServiceApplication | Get-SPExcelFileLocation | where {$_.Address -eq "https://"} | Set-SPExcelFileLocation -Description "This is the default trusted file location for Excel Services Application. It allows any file from anywhere in SharePoint to load."

此範例會變更伺服器陣列中每一個 Excel Services 應用程式 Web 服務應用程式的預設檔案位置說明。

參數

-AbortOnRefreshOnOpenFail

Specifies that the load of a Excel Services Application file automatically fails if an automatic data refresh operation fails when the file is opened. The load is failed only if the following conditions are true:

-- 使用者具有 Excel Services 應用程式檔案的唯讀權限。 -- 當 Excel 檔案開啟時,活頁簿檔案具有自動重新整理的資料連線。

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-Address

System.String

這會指定 Web 資料夾或檔案目錄,以供 Excel Services 應用程式載入活頁簿。

其類型必須為有效的 URL,且格式為 https://myPortal/myTeam;或是有效的 UNC 路徑,且格式為 \\server_name\folder_name

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-AssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-AutomaticVolatileFunctionCacheLifetime

Specifies the maximum time, in seconds, that a computed value for a volatile function is cached for automatic recalculations. Valid values include:

-1,活頁簿載入時計算一次

0,一律計算

1 到 2073600,快取 1 秒到 24 天

其類型必須是整數 -1 或 0,或是介於 1 到 2073600 的整數值。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-ChartAndImageSizeMax

Specifies the maximum size, in megabytes, of a chart or image that can be opened. The default value is 1.

其類型必須為大於 0 的有效整數。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-ChartRenderDurationMax

呈現任何單一圖表所花的時間上限 (以秒為單位)。

有效值:-1 (無限制);從 1 到 2073600 (24 天)。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-ConcurrentDataRequestsPerSessionMax

Specifies the maximum number of concurrent external data requests allowed in each session. If a session must issue more than this number of requests, additional requests must be queued. The scope of this setting is the logical server. The default value is 5.

此類型必須是正整數。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-Confirm

在執行命令之前,提示您確認操作。 如需詳細資訊,請輸入下列命令:get-help about_commonparameters

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-DefaultWorkbookCalcMode

Specifies the calculation mode of workbooks. All of the settings except the File setting override the workbook settings. If this parameter is changed, it is applied to all new sessions on Excel Services Application when the ConfigDB properties cache is refreshed. The default setting is File.

其類型必須為下列其中之一:File、Manual、Auto 或 AutoDataTables。

Type:DefaultWorkbookCalcMode
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-Description

這會指定新檔案位置的易懂說明。

其類型必須為有效的字串;例如,這是月銷售報表的檔案位置。

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-DisplayGranularExtDataErrors

這會針對此位置的檔案,顯示外部資料失敗時的詳細錯誤訊息。

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-ExcelServiceApplication

指定包含 SPExcelFileLocation 清單物件的 Excel Services 應用程式 Web 服務應用程式。

其類型必須為有效的 GUID,且格式為 12345678-90ab-cdef-1234-567890bcdefgh;在伺服器陣列 (例如,MyExcelService1) 中,Excel Services 應用程式 Web 服務應用程式的有效名稱;或是有效之 SPExcelServiceApplication 物件的執行個體。

Type:SPExcelServiceApplicationPipeBind
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-ExternalDataAllowed

Specifies the type of external data access allowed for workbooks: None specifies that data refresh is disabled. Dcl specifies that data is refreshed only when it uses a connection file in a trusted data connection library. DclandEmbedded specifies that a data connection library can be used but is not required. The scope of this setting is the trusted location.

預設值為 None。

其類型必須為下列其中之一:None、Dcl 或 DclAndEmbedded。

Type:AllowExternalData
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-Identity

Specifies the FileLocation object to update. The name must be unique in the list of file locations.

其類型必須為有效的 GUID,且格式為 12345678-90ab-cdef-1234-567890bcdefgh;識別檔案位置的有效字串,且格式為 https://myPortal/myTeam;識別路徑的有效字串,且格式為 C:\folder_name;或是有效之 SPExcelFileLocation 物件的執行個體。

Type:SPExcelFileLocationPipeBind
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-IncludeChildren

這會指定信任的下層 URL、目錄及程式庫。 例如,如果受信任檔案位置為 https://portal,而且 IncludeChildren 為 True,則也會信任 https://portal/subSite,與 Address 中指定之 subURL 下的任何 URL 一樣。

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-LocationType

The type of location. LocationType indicates how Excel Services Application retrieves files from that location specified in Address. The default value is SharePoint.

其類型必須為下列其中之一:SharePoint、UNC 或 HTTP。

Type:LocationType
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-ManualExtDataCacheLifetime

Specifies the time, in seconds, that Excel Services Application waits before re-issuing a manual, or user-initiated, external data request. During this period, the results from the previous external data request may be returned from an external data cache.

有效值為:

-1 開始查詢後不再重新整理

1 到 2073600 快取 1 秒到 24 天。

預設值為 300。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-NewWorkbookSessionTimeout

Specifies the time, in seconds, that a session for a new, unsaved, workbook will remain active on Excel Services Application with no user activity. The default value 1800. Valid values include the following:

-1,工作階段永遠不過期

0,工作階段在單一要求結束時到期

1 到 2073600,保持使用中 1 秒到 24 天。

其類型必須為 -1、0,或是介於 1 到 2073600 的整數。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-PeriodicExtDataCacheLifetime

Specifies the time, in seconds, that Excel Services Application waits before re-issuing an on-open or periodic (that is, automatic) external data request. During this period, the results from the previous external data request may be returned from an external data cache. A value -1 specifies to never refresh after the first query.

其類型必須為 -1、0,或是介於 1 到 2073600 的整數。

預設值為 300。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-RequestDurationMax

Specifies the maximum duration, in seconds, for a single request in a session. After this time elapses the request is timed out.

其類型必須為 -1 (沒有限制),或是介於 1 到 2073600 的整數。

預設值為 300。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-RESTExternalDataAllowed

這會指定是否允許來自代表性狀態傳輸 (REST) 應用程式開發介面 (API) 的要求重新整理外部資料連線。

如果 External DataAllowed 參數設定為 None,則 RESTExternalDataAllowed 參數沒有作用。

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-SessionTimeout

Specifies the time, in seconds, that a session will remain active on Excel Services Application with no user activity. The default is 300 seconds. The default value is 300. Valid values include:

-1,工作階段永遠不過期

0,工作階段在單一要求結束時到期

1 到 2073600,保持使用中 1 秒到 24 天

其類型必須為 -1、0,或是介於 1 到 2073600 的整數。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-ShortSessionTimeout

Specifies the time, in seconds, that a user has to make the initial interaction with a spreadsheet. After this time has elapsed, if the user is not active, then the session is closed. The value must always be less than SessionTimeout. If the ShortSessionTimeout value is greater than or equal to SessionTimeout, an error is returned. The default value is 75.

其類型必須為 -1,或是介於 1 到 2073600 的整數。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-UdfsAllowed

這會指定從信任的檔案位置 (根據 Address 所指定) 載入之活頁簿,可以呼叫使用者定義的函數。

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-WarnOnDataRefresh

Specifies that a warning is displayed to the user on the first refresh of data for the workbook. The default value is True.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-WhatIf

顯示訊息會描述命令的功效而不執行命令。 如需詳細資訊,請輸入下列命令:get-help about_commonparameters

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013

-WorkbookSizeMax

Specifies the maximum size, in megabytes, of a workbook that can be loaded. The default value is 10.

其類型必須為整數值,且介於 1 到 2000 之間。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2010, SharePoint Server 2013