New-CMGlobalConditionSqlQuery
Creates a SQL Query type global condition in Configuration Manager.
Syntax
New-CMGlobalConditionSqlQuery
[-AllInstances]
-Column <String>
-Database <String>
-DataType <GlobalConditionDataType>
-FilePath <String>
[-InstanceName <String>]
[-Description <String>]
-Name <String>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
New-CMGlobalConditionSqlQuery
[-AllInstances]
-Column <String>
-Database <String>
-DataType <GlobalConditionDataType>
[-InstanceName <String>]
-QueryText <String>
[-Description <String>]
-Name <String>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
Description
The New-CMGlobalConditionSqlQuery cmdlet creates a SQL Query type global condition in Configuration Manager.
A global condition is a setting or expression in Configuration Manager that you can use to specify how Configuration Manager provides and deploys an application to clients.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
Examples
Example 1
$GlobalSql = New-CMGlobalConditionSqlQuery -DataType String -QueryText $string -Database ss -Column aa -Name GC6
This command creates a SQL Query type global condition in Configuration Manager.
Parameters
-AllInstances
Indicates that the global condition searches all database instances. To search a named instance, specify the InstanceName parameter. To search the default instance, specify the UseDefaultInstance parameter.
Type: | SwitchParameter |
Aliases: | UseAllInstances |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Column
Specifies the column name used to assess the compliance of the global condition.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Database
Specifies a database name.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DataType
Specifies a data type.
Type: | GlobalConditionDataType |
Accepted values: | String, DateTime, Integer, FloatingPoint, Version, Boolean |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
Specifies a description.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-FilePath
Specifies a file path.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InstanceName
Specifies a instance where you want to run the SQL Query.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Specifies a name.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-QueryText
Specifies the full SQL query to use for the global condition.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
None
Outputs
System.Object
Related Links
- Set-CMGlobalConditionSqlQuery
- New-CMGlobalCondition
- New-CMGlobalConditionActiveDirectoryQuery
- New-CMGlobalConditionAssembly
- New-CMGlobalConditionFile
- New-CMGlobalConditionIisMetabase
- New-CMGlobalConditionOmaUri
- New-CMGlobalConditionRegistryKey
- New-CMGlobalConditionRegistryValue
- New-CMGlobalConditionScript
- New-CMGlobalConditionWqlQuery
- New-CMGlobalConditionXPathQuery