Set-CMGlobalConditionSqlQuery

SYNOPSIS

Sets a SQL Query type global condition in Configuration Manager.

SYNTAX

SetQueryFromFile (Default)

Set-CMGlobalConditionSqlQuery [-FilePath <String>] [-UseDefaultInstance] [-UseAllInstances]
 [-InstanceName <String>] [-Database <String>] [-Column <String>] -Name <String> [-PassThru]
 [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]

SetQueryFromText

Set-CMGlobalConditionSqlQuery [-QueryText <String>] [-UseDefaultInstance] [-UseAllInstances]
 [-InstanceName <String>] [-Database <String>] [-Column <String>] -Name <String> [-PassThru]
 [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]

DESCRIPTION

The Set-CMGlobalConditionSqlQuery cmdlet modifies settings for a SQL Query type global condition in Microsoft System Center Configuration Manager.

EXAMPLES

Example 1

PS C:\> $GlobalSql = Set-CMGlobalConditionSqlQuery -DataType String -QueryText $string -Database ss -Column aa –Name GC6

This command sets a SQL Query type global condition in Configuration Manager.

PARAMETERS

-Column

Specifies the column name returned by the Transact-SQL statement to use to assess the compliance of the global condition.

Type: String
Parameter Sets: (All)
Aliases:

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

-Database

Specifies the name of the Microsoft SQL Server database for which the SQL query will be run.

Type: String
Parameter Sets: (All)
Aliases:

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

-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-FilePath

Specifies a file path.

Type: String
Parameter Sets: SetQueryFromFile
Aliases:

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

-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-InstanceName

Specifies a SQL Server instance where you want the SQL Query to run on.

Type: String
Parameter Sets: (All)
Aliases:

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

-Name

Specifies a name.

Type: String
Parameter Sets: (All)
Aliases:

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

-PassThru

Returns the current working object. By default, this cmdlet does not generate any output.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-QueryText

Specifies the full SQL query to use for the global condition.

Type: String
Parameter Sets: SetQueryFromText
Aliases:

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

-UseAllInstances

Indicates running the SQL query on all instances.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-UseDefaultInstance

Indicates running the SQL query on the default instance.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

OUTPUTS

System.Object