Citrix Daas SDK

Remove-LogOperation

Deletes configuration logs

Syntax

Remove-LogOperation
      -DatabaseCredentials <PSCredential>
      [-StartDateRange <DateTime>]
      [-EndDateRange <DateTime>]
      [-IncludeIncomplete]
      [-LoggingId <Guid>]
      [<CitrixCommonParameters>]
      [<CommonParameters>]
<!--NeedCopy-->
Remove-LogOperation
      -UserName <String>
      [-Password <String>]
      [-StartDateRange <DateTime>]
      [-EndDateRange <DateTime>]
      [-IncludeIncomplete]
      [-LoggingId <Guid>]
      [<CitrixCommonParameters>]
      [<CommonParameters>]
<!--NeedCopy-->
Remove-LogOperation
      -UserName <String>
      -SecurePassword <SecureString>
      [-StartDateRange <DateTime>]
      [-EndDateRange <DateTime>]
      [-IncludeIncomplete]
      [-LoggingId <Guid>]
      [<CitrixCommonParameters>]
      [<CommonParameters>]
<!--NeedCopy-->

Description

Remove-LogOperation deletes logs from the Configuration Logging database. This cmdlet targets high level operation logs for deletion. The associated low level operations logs are deleted as part of this operation via cascade deletion functionality present in the configuration logging database schema.

Examples

EXAMPLE 1

Remove all completed operation logs

Remove-LogOperation  -UserName "DOMAIN\User"  -Password "UserPassword"
<!--NeedCopy-->

EXAMPLE 2

Remove all operations

Remove-LogOperation  -UserName "DOMAIN\User"  -Password "UserPassword" -IncludeIncomplete
<!--NeedCopy-->

EXAMPLE 3

Delete logs started on or after “2023-01-01 12:00:00” and completed on or before “2023-01-31 12:00:00”

Remove-LogOperation -username "domain\userName" -password "password" -StartDateRange "2023-01-01 12:00:00"  -EndDateRange "2023-01-31 12:00:00"
<!--NeedCopy-->

EXAMPLE 4

Delete logs by supplying database user credentials via a credentials object.

$securePassword = ConvertTo-SecureString -String "UserPassword" -AsPlainText -Force
$credentials    = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "DOMAIN\UserName", $securePassword
Remove-LogOperation -StartDateRange -DatabaseCredentials $credentials
<!--NeedCopy-->

Parameters

-DatabaseCredentials

Specifies the credentials of a database user with permission to delete records from the Configuration Logging database.

Type: PSCredential
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-UserName

Specifies the user name of a database user with permission to delete records from the Configuration Logging database.

Type: String
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-SecurePassword

Specifies the password a database user, in secure string form, with permission to delete records from the Configuration Logging database.

Type: SecureString
Position: Named
Default value: None
Required: True
Accept pipeline input: False
Accept wildcard characters: False

-Password

Specifies the password of a database user with permission to delete records from the Configuration Logging database.

Type: String
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-StartDateRange

Specifies the start time of the earliest high level operation to delete

Type: DateTime
Position: Named
Default value: DateTime.Min
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-EndDateRange

Specifies the end time of the latest high level operation to delete

Type: DateTime
Position: Named
Default value: DateTime.UtcNow
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-IncludeIncomplete

Specifies if incomplete high level operations should be deleted.

Type: SwitchParameter
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

-LoggingId

Specifies the identifier of the high-level operation this cmdlet call forms a part of. Citrix Studio and Director typically create high-level operations. PowerShell scripts can also wrap a series of cmdlet calls in a high-level operation by way of the Start-LogHighLevelOperation and Stop-LogHighLevelOperation cmdlets.

Type: Guid
Position: Named
Default value: None
Required: False
Accept pipeline input: False
Accept wildcard characters: False

CitrixCommonParameters

This cmdlet supports the common Citrix parameters: -AdminAddress, -AdminClientIP, -BearerToken, -TraceParent, -TraceState and -VirtualSiteId. For more information, see about_CitrixCommonParameters.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

You can’t pipe objects to this cmdlet.

Outputs

None

By default, this cmdlet returns no output.

Remove-LogOperation