Set-SPUsageService

更新使用率服务的属性。

语法

Set-SPUsageService
   [[-Identity] <SPUsageServicePipeBind>]
   [-AssignmentCollection <SPAssignmentCollection>]
   [-Confirm]
   [-LoggingEnabled <Boolean>]
   [-UsageLogCutTime <UInt32>]
   [-UsageLogLocation <String>]
   [-UsageLogMaxFileSizeKB <UInt32>]
   [-UsageLogMaxSpaceGB <UInt32>]
   [-WhatIf]
   [<CommonParameters>]

说明

Set-SPUsageService cmdlet 更新使用服务的属性。 如果未指定 Identity 参数,此 cmdlet 则将更改应用于本地使用率服务。

有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet

示例

--------------------示例-----------------

Set-SPUsageService -LoggingEnabled $false
Set-SPUsageService -UsageLogLocation "D:\\testusagelogdir"
Set-SPUsageService -UsageLogCutTime 5

这些示例禁用使用情况日志记录,更改存储使用情况文件的目录,并每隔 5 分钟创建一个新的使用日志文件。

参数

-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 Subscription Edition

-Identity

指定要更新的使用率服务。

键入的值必须是以下格式之一:

--一个有效的 GUID,格式为 12345678-90ab-cdef-1234-567890bcdefgh --使用服务的有效名称 (例如 UsageService1) --一个有效的 SPUsageService 对象的实例。

Type:SPUsageServicePipeBind
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-LoggingEnabled

指定将使用率数据记录到使用率文件中。

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-UsageLogCutTime

指定每一使用率日志文件收集使用率数据的时间(以分钟为单位)。 默认时间为 5 分钟。

该值必须为介于 1 到 1440 之间的整数。

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-UsageLogLocation

指定将在服务器场中的各计算机上创建使用率日志文件的位置。

该值必须为以下格式的有效本地路径:

  • C:\folder_name
Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-UsageLogMaxFileSizeKB

指定适用于所有使用率提供程序的单个使用率文件的最大大小。

最小值为 512 KB,最大值为 65536 KB。

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-UsageLogMaxSpaceGB

) 使用日志允许的最大空间量 (以 GB 为单位。 尽管该参数在以后的 SharePoint Server 版本中存在,但它仅适用于 SharePoint Server 2010。

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WhatIf

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: 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 Subscription Edition

-工作分配

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 Subscription Edition