Skip to content

Get SqlDscTraceFlag

dscbot edited this page Mar 3, 2024 · 2 revisions

Get-SqlDscTraceFlag

SYNOPSIS

Get current trace flags on a Database Engine instance.

SYNTAX

ByServerName (Default)

Get-SqlDscTraceFlag [-ServerName <String>] [-InstanceName <String>] 
 [<CommonParameters>]

ByServiceObject

Get-SqlDscTraceFlag -ServiceObject <Service> [<CommonParameters>]

DESCRIPTION

Get current trace flags on a Database Engine instance.

EXAMPLES

EXAMPLE 1

Get-SqlDscTraceFlag

Get all the trace flags from the Database Engine default instance on the server where the command in run.

EXAMPLE 2

$serviceObject = Get-SqlDscManagedComputerService -ServiceType 'DatabaseEngine'
Get-SqlDscTraceFlag -ServiceObject $serviceObject

Get all the trace flags from the Database Engine default instance on the server where the command in run.

EXAMPLE 3

Get-SqlDscTraceFlag -InstanceName 'SQL2022'

Get all the trace flags from the Database Engine instance 'SQL2022' on the server where the command in run.

EXAMPLE 4

$serviceObject = Get-SqlDscManagedComputerService -ServiceType 'DatabaseEngine' -InstanceName 'SQL2022'
Get-SqlDscTraceFlag -ServiceObject $serviceObject

Get all the trace flags from the Database Engine instance 'SQL2022' on the server where the command in run.

PARAMETERS

-InstanceName

Specifies the instance name to return the trace flags for.

Type: String
Parameter Sets: ByServerName
Aliases:

Required: False
Position: Named
Default value: MSSQLSERVER
Accept pipeline input: False
Accept wildcard characters: False

-ServerName

Specifies the server name to return the trace flags from.

Type: String
Parameter Sets: ByServerName
Aliases:

Required: False
Position: Named
Default value: (Get-ComputerName)
Accept pipeline input: False
Accept wildcard characters: False

-ServiceObject

Specifies the Service object to return the trace flags from.

Type: Service
Parameter Sets: ByServiceObject
Aliases:

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

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

OUTPUTS

[System.UInt32[]]

NOTES

RELATED LINKS

Home

Commands

Resources

Usage

Clone this wiki locally