Merge-SPUsageLog
从使用率日志文件返回记录。
语法
Default (默认值)
Merge-SPUsageLog
[-Identity] <SPUsageDefinitionPipeBind>
[-AssignmentCollection <SPAssignmentCollection>]
[-DiagnosticLogPath <String>]
[-EndTime <DateTime>]
[-OverWrite]
[-Partial]
[-Servers <String[]>]
[-StartTime <DateTime>]
[<CommonParameters>]
说明
Merge-SPUsageLog cmdlet 从匹配条件的每个场服务器上的使用率日志文件返回记录,然后将结果写入管道。
命令按照用户指定的条件收集、筛选和聚合日志,我们建议使用 StartTime 和 EndTime 参数进行筛选,以优化此 cmdlet 的性能。
至少应指定一个使用类型。 有关有效使用类型的信息,请参阅 Get-SPUsageDefinition。
此 cmdlet 需要启用 PowerShell 远程处理。
示例
示例 1
Merge-SPUsageLog -Identity 'Timer Jobs' -Servers SPSERVER1
将指定服务器中的使用情况定义“计时器作业”的使用情况日志合并到 PowerShell 控制台。
参数
-AssignmentCollection
适用:SharePoint Server 2016,SharePoint Server 2019
管理对象以便正确进行处理。 使用 SPWeb 或 SPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。 通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。 在使用 SPWeb、SPSite 或 SPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。
在使用 Global 参数时,所有对象均包含在全局存储中。 如果未立即使用对象,或未通过使用 Stop-SPAssignment 命令来处理对象,则可能会发生内存不足的情况。
参数属性
| 类型: | SPAssignmentCollection |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-DiagnosticLogPath
适用:SharePoint Server 2016,SharePoint Server 2019
指定要写入诊断信息的文件。 支持相对路径。
参数属性
| 类型: | String |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-EndTime
适用:SharePoint Server 2016,SharePoint Server 2019
指定所返回日志条目的结束时间。
键入的值必须是管理语言的区域性特定的有效日期时间格式,即美国英语的日期时间格式为 2/16/2007 12:15:12。
默认值为当前时间。
若要指定 UTC 时间,必须在参数末尾添加"Z"。 例如:"2016-06-15 03:29:18.199 Z"。 如果不指定"Z",将显示本地计算机时间,而不是 UTC 时间。
参数属性
| 类型: | DateTime |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Identity
适用:SharePoint Server 2016,SharePoint Server 2019
指定使用率日志文件的名称。
参数属性
| 类型: | SPUsageDefinitionPipeBind |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | 0 |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-OverWrite
适用:SharePoint Server 2016,SharePoint Server 2019
覆盖诊断日志文件(如果该文件在指定的路径已经存在)。
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Partial
适用:SharePoint Server 2016,SharePoint Server 2019
未使用。
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Servers
适用:SharePoint Server 2016,SharePoint Server 2019
要筛选的服务器地址或地址。
若要获取场中有效地址的列表,请使用“Get-SPServer | Select Address”。
参数属性
| 类型: | String[] |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-StartTime
适用:SharePoint Server 2016,SharePoint Server 2019
指定返回日志条目的开始时间。
键入的值必须是管理语言的区域性特定的有效日期时间格式,如美国英语的日期时间格式为"2/16/2007 12:15:12"。
默认值比本地计算机上的当前时间早一个小时。
若要指定 UTC 时间,必须在参数末尾添加"Z"。 例如:"2016-06-15 03:29:18.199 Z"。 如果不指定"Z",将显示本地计算机时间,而不是 UTC 时间。
参数属性
| 类型: | DateTime |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
输入
Microsoft.SharePoint.PowerShell.SPUsageDefinitionPipeBind
Microsoft.SharePoint.PowerShell.SPAssignmentCollection