Set-CMGlobalCondition

Modifies settings for a Configuration Manager global condition.

Syntax

Set-CMGlobalCondition
   [-Description <String>]
   -Name <String>
   [-NewName <String>]
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   [-AssemblyName <String>]
   -Name <String>
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   [-Class <String>]
   -Name <String>
   [-Namespace <String>]
   [-PassThru]
   [-Property <String>]
   [-WhereClause <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   [-Column <String>]
   [-Database <String>]
   [-FilePath <String>]
   -Name <String>
   [-PassThru]
   [-UseDefaultInstance]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   [-Column <String>]
   [-Database <String>]
   [-FilePath <String>]
   -Name <String>
   [-PassThru]
   [-UseAllInstances]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   [-Column <String>]
   [-Database <String>]
   [-FilePath <String>]
   [-InstanceName <String>]
   -Name <String>
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   [-DistinguishedName <String>]
   [-LdapFilter <String>]
   [-LdapPrefix <String>]
   -Name <String>
   [-PassThru]
   [-Property <String>]
   [-SearchScope <SearchScope>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   [-FileOrFolderName <String>]
   [-IncludeSubfolder <Boolean>]
   [-Is64Bit <Boolean>]
   -Name <String>
   [-PassThru]
   [-Path <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   [-FilePath <String>]
   [-IncludeSubfolder <Boolean>]
   [-Is64Bit <Boolean>]
   -Name <String>
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   [-FilePath <String>]
   -Name <String>
   [-PassThru]
   [-ScriptLanguage <ScriptingLanguage>]
   [-Use32BitHost <Boolean>]
   [-UseLoggedOnUserCredential <Boolean>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   [-FilePath <String>]
   [-IncludeSubfolder <Boolean>]
   [-Is64Bit <Boolean>]
   -Name <String>
   [-PassThru]
   [-XmlFilePath <String>]
   [-XmlNamespace <String[]>]
   [-XPathQuery <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   [-Is64Bit <Boolean>]
   [-KeyName <String>]
   -Name <String>
   [-PassThru]
   [-RegistryHive <RegistryRootKey>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   [-Is64Bit <Boolean>]
   [-KeyName <String>]
   -Name <String>
   [-PassThru]
   [-RegistryHive <RegistryRootKey>]
   [-ValueName <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   [-MetabasePath <String>]
   -Name <String>
   [-PassThru]
   [-PropertyId <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-CMGlobalCondition
   -Name <String>
   -OmaUri <String>
   [-PassThru]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-CMGlobalCondition cmdlet modifies settings for a global condition. You can add or remove a security scope for a global condition. You can specify a global condition by name or ID, or use the Get-CMGlobalCondition cmdlet to obtain a global condition object.

Configuration Manager uses global conditions to represent business or technical conditions. Global conditions specify how to provide and deploy applications to client devices.

Each global condition must have at least one security scope.

Note

Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.

Examples

Example 1: Add a security scope

PS XYZ:\> Set-CMGlobalCondition -Name "CPU speed" -SecurityScopeAction AddMembership -SecurityScopeName "Scope22"

This command adds the security scope named Scope22 to the global condition named CPU speed.

Example 2: Remove a security scope by using a variable

PS XYZ:\> $CMGC = Get-CMGlobalCondition -Name "CPU speed"
PS XYZ:\> Set-CMGlobalCondition -InputObject $CMGC -SecurityScopeAction RemoveMembership -SecurityScopeName "Scope22"

The first command uses the Get-CMGlobalCondition cmdlet to get the global condition named CPU speed and store it in the $CMGC variable.

The second command removes the security scope named Scope22 from the global condition stored in the $CMGC variable.

Parameters

-AssemblyName

Specifies the name of an assembly for which to search. An assembly name must be registered in the global assembly cache.

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

-Class

Specifies a Windows Management Instrumentation (WMI) class used to build a WMI Query Language (WQL) query. The query assesses compliance on client computers.

Type:String
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:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-Database

Specifies the name of a database. The SQL query runs on this database.

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

-Description

Specifies a description for the global condition.

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

-DistinguishedName

Specifies the distinguished name of the Active Directory Domain Services (AD DS) object to assess for compliance on client computers.

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

-FileOrFolderName

Specifies the name of a file or folder. Specify the IsFolder parameter to search for a folder.

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

-FilePath

Specifies a file path for the file that the condition assesses for compliance.

Type:String
Position:Named
Default value:None
Required:False
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

-IncludeSubfolder

Indicates whether the cmdlet includes subfolders in the operation.

Type:Boolean
Aliases:IncludeSubfolders
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InstanceName

Specifies the name of a database instance that the global condition searches. To search the default instance, specify the UseDefaultInstance parameter. To search all instances, specify the UseAllInstances parameter.

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

-Is64Bit

Indicates that the global condition searches the 64-bit system file location in addition to the 32-bit system file location.

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

-KeyName

Specifies the registry key name for which to search. Use the format key\subkey.

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

-LdapFilter

Specifies a Lightweight Directory Access Protocol (LDAP) filter to refine the results from the AD DS query to assess compliance on client computers.

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

-LdapPrefix

Specifies a valid LDAP prefix for the AD DS query that assesses compliance on client computers. The acceptable values for this parameter are: LDAP:// or GC://.

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

-MetabasePath

Specifies the path to the metabase file for Internet Information Services (IIS).

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

-Name

Specifies the name of the global conditions. This value corresponds to the LocalizedDisplayName property of a global condition object.

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

-Namespace

Specifies a namespace from a WMI repository. The default value is Root\cimv2.

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

-NewName

Specifies a new name for the global condition.

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

-OmaUri

Specifies a Uniform Resource Indicator (URI) that points to device-specific parameters for an Open Mobile Alliance (OMA) device.

Type:String
Position:Named
Default value:None
Required:True
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
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Path

Specifies the path for an OMA URI.

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

-Property

Specifies the property of the AD DS object used to assess compliance on client computers.

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

-PropertyId

Specifies the property of AD DS that Configuration Manager uses to determine client compliance.

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

-RegistryHive

Specifies the root key in the registry that identifies the registry hive that you search. WMI uses the registry hive to return, set, and change the values of registry keys. The acceptable values for this parameter are:

  • ClassesRoot
  • CurrentConfig
  • CurrentUser
  • LocalMachine
  • Users
Type:RegistryRootKey
Accepted values:ClassesRoot, CurrentConfig, CurrentUser, LocalMachine, Users
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ScriptLanguage

Specifies a scripting language to use. The acceptable values for this parameter are:

  • PowerShell
  • VBScript
  • JScript
Type:ScriptingLanguage
Accepted values:PowerShell, VBScript, JScript, ShellScript
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SearchScope

Specifies the search scope in AD DS. The acceptable values for this parameter are:

  • Base
  • OneLevel
  • Subtree
Type:SearchScope
Accepted values:Base, OneLevel, Subtree
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Use32BitHost

Indicates that the file or folder is associated with a 64-bit application.

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

-UseAllInstances

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
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UseDefaultInstance

Indicates that the global condition searches the default database instance. To search a named instance, specify the InstanceName parameter. To search all instances, specify the UseAllInstances parameter.

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

-UseLoggedOnUserCredential

Indicates whether to use logged on user credentials.

Type:Boolean
Aliases:UseLoggedOnUserCredentials
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ValueName

Specifies the value to be contained in the specified registry key.

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

-WhatIf

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

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

-WhereClause

Specifies a WQL query WHERE clause to apply to the specified namespace, class, and property on client computers.

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

-XmlFilePath

Specifies a file that contains the XML query to use to assess compliance on client computers.

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

-XmlNamespace

Specifies an array of valid, full XML path language (XPath) queries to use to assess compliance on client computers.

Type:String[]
Aliases:XmlNamespaces
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-XPathQuery

Specifies a XPath query.

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

Inputs

None

Outputs

System.Object