Export (0) Print
Expand All

Set-SPUsageService

Published: July 16, 2012

Applies to:  SharePoint Server 2013 Standard 

Updates the properties of a usage service.

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

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPUsageServicePipeBind

Specifies the usage service to update.

The type must be in one of the following forms:

--A valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh

--A valid name of a usage service (for example, UsageService1)

--An instance of a valid SPUsageService object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

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.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

LoggingEnabled

Optional

System.Nullable

Specifies that usage data is logged to usage files.

UsageLogCutTime

Optional

System.UInt32

Specifies the time, in minutes, of usage data that is collected per usage log file. The default time is 5 minutes.

The value must be an integer in the range of 1 to 1440.

UsageLogLocation

Optional

System.String

Specifies the path on every computer in the farm where usage log files are created.

The value must be a valid local path in the following form:

- C:\folder_name

UsageLogMaxFileSizeKB

Optional

System.UInt32

Specifies the maximum size of a single usage file that is applied to all the usage providers.

The minimum value is 512 kilobytes (KB) and the maximum value is 65536 KB.

UsageLogMaxSpaceGB

Optional

System.UInt32

The parameter is not used in SharePoint Server 2013.

WhatIf

Optional

System.Management.Automation.SwitchParameter

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

Detailed Description

The Set-SPUsageService cmdlet updates the properties of a usage service. If the Identity parameter is not specified, the cmdlet applies the changes to the local usage service.

Input Types

Return Types

--------------------EXAMPLE-----------------

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

The examples disables usage logging, changes the directory where usage files are stored, and creates a new usage log file every 5 minutes.

Change History

Date Description

July 16, 2012

Initial publication

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft