Set-CMGlobalCondition
Set-CMGlobalCondition
Modifies settings for a Configuration Manager global condition.
Syntax
Parameter Set: SetADQuery
Set-CMGlobalCondition -Name <String> [-DistinguishedName <String> ] [-LdapFilter <String> ] [-LdapPrefix <String> ] [-Property <String> ] [-SearchScope <SearchScope> {Base | OneLevel | Subtree} ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetAssembly
Set-CMGlobalCondition -Name <String> [-AssemblyName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetFileSystem
Set-CMGlobalCondition -Name <String> [-FileOrFolderName <String> ] [-IncludeSubfolders] [-Is64Bit] [-Path <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetFileSystemFile
Set-CMGlobalCondition -Name <String> [-FilePath <String> ] [-IncludeSubfolders] [-Is64Bit] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetGeneral
Set-CMGlobalCondition -Name <String> [-Description <String> ] [-NewName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetIisMetabase
Set-CMGlobalCondition -Name <String> [-MetabasePath <String> ] [-PropertyId <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetOmaUri
Set-CMGlobalCondition -Name <String> [-OmaUri <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetRegistryKey
Set-CMGlobalCondition -Name <String> [-Is64Bit] [-KeyName <String> ] [-RegistryHive <RegistryRootKey> {ClassesRoot | CurrentConfig | CurrentUser | LocalMachine | Users} ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetRegistryValue
Set-CMGlobalCondition -Name <String> [-Is64Bit] [-KeyName <String> ] [-RegistryHive <RegistryRootKey> {ClassesRoot | CurrentConfig | CurrentUser | LocalMachine | Users} ] [-ValueName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetScript
Set-CMGlobalCondition -Name <String> [-FilePath <String> ] [-ScriptLanguage <ScriptingLanguage> {PowerShell | VBScript | JScript | ShellScript} ] [-Use32BitHost] [-UseLoggedOnUserCredentials] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetSecurityScopeByName
Set-CMGlobalCondition -Name <String> -SecurityScopeAction <SecurityScopeActionType> {AddMembership | RemoveMembership} -SecurityScopeName <String> [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetSqlQueryAllInstances
Set-CMGlobalCondition -Name <String> [-Column <String> ] [-Database <String> ] [-FilePath <String> ] [-UseAllInstances] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetSqlQueryDefaultInstance
Set-CMGlobalCondition -Name <String> [-Column <String> ] [-Database <String> ] [-FilePath <String> ] [-UseDefaultInstance] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetSqlQuerySpecificInstance
Set-CMGlobalCondition -Name <String> [-Column <String> ] [-Database <String> ] [-FilePath <String> ] [-InstanceName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetWqlQuery
Set-CMGlobalCondition -Name <String> [-Class <String> ] [-Namespace <String> ] [-Property <String> ] [-WhereClause <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: SetXPathQuery
Set-CMGlobalCondition -Name <String> [-FilePath <String> ] [-IncludeSubfolders] [-Is64Bit] [-XmlFilePath <String> ] [-XmlNamespace <String[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed 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.
Microsoft System Center 2012 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.
Parameters
-AssemblyName<String>
Specifies the name of an assembly for which to search. An assembly name must be registered in the global assembly cache.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Class<String>
Specifies a Windows Management Instrumentation (WMI) class used to build a WMI Query Language (WQL) query. The query assesses compliance on client computers.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Column<String>
Specifies the column name used assess the compliance of the global condition.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Database<String>
Specifies the name of a database. The SQL query runs on this database.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Description<String>
Specifies a description for the global condition.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-DistinguishedName<String>
Specifies the distinguished name of the Active Directory Domain Services (AD DS) object to assess for compliance on client computers.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-FileOrFolderName<String>
Specifies the name of a file or folder. Specify the IsFolder parameter to search for a folder.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-FilePath<String>
Specifies a file path for the file that the condition assesses for compliance.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-IncludeSubfolders
Indicates that the global condition searches in subfolders.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-InstanceName<String>
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.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
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.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-KeyName<String>
Specifies the registry key name for which to search. Use the format key\subkey.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-LdapFilter<String>
Specifies an LDAP filter to refine the results from the AD DS query to assess compliance on client computers.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-LdapPrefix<String>
Specifies a valid Lightweight Directory Access Protocol (LDAP) prefix for the AD DS query that asseses compliance on client computers. This prefix can be either LDAP:// or GC://.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-MetabasePath<String>
Specifies the path to the metabase file for Internet Information Services (IIS).
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Name<String>
Specifies the name of the global conditions. This value corresponds to the LocalizedDisplayName property of a global condition object.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Namespace<String>
Specifies a namespace from a WMI repository. The default value is Root\cimv2.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-NewName<String>
Specifies a new name for the global condition.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-OmaUri<String>
Specifies a Uniform Resource Indicator (URI) that points to device-specific parameters for an Open Mobile Alliance (OMA) device.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Path<String>
Specifies the path for an OMA URI.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Property<String>
Specifies the property of the AD DS object used to assess compliance on client computers.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-PropertyId<String>
Specifies the property of AD DS that Configuration Manager uses to determine client compliance.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-RegistryHive<RegistryRootKey>
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, and Users.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ScriptLanguage<ScriptingLanguage>
Specifies a scripting language to use. The acceptable values for this parameter are: PowerShell, VBScript, and JScript.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-SearchScope<SearchScope>
Specifies the search scope in AD DS. The acceptable values for this parameter are: Base, OneLevel, and Subtree.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-SecurityScopeAction<SecurityScopeActionType>
Specifies an action for the security scope specified in the SecurityScopeName parameter. The acceptable values for this parameter are:
-- AddMembership
-- RemoveMembership
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-SecurityScopeName<String>
Specifies a security scope. If the SecurityScopeAction parameter has a value of AddMembership, this cmdlet adds this security scope to the global condition. If the SecurityScopeAction parameter has a value of RemoveMembership, this cmdlet removes this security scope from the global condition.
The SecuredScopeNames property of a global condition stores all the security scopes for that condition.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Use32BitHost
Indicates that the file or folder is associated with a 64-bit application.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
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.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
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.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-UseLoggedOnUserCredentials
Indicates that the script runs on client computers by using the logged on user credentials.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ValueName<String>
Specifies the value to be contained in the specified registry key.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-WhereClause<String>
Specifies a WQL query WHERE clause to apply to the specified namespace, class, and property on client computers.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-XmlFilePath<String>
Specifies a file that contains the XML query to use to assess compliance on client computers.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-XmlNamespace<String[]>
Specifies an array of valid, full XML path language (XPath) queries to use to assess compliance on client computers.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Add a security scope
This command adds the security scope named Scope22 to the global condition named CPU speed.
PS C:\> Set-CMGlobalCondition -Name "CPU speed" -SecurityScopeAction AddMembership -SecurityScopeName "Scope22"
Example 2: Remove a security scope by using a variable
This example removes the security scope named Scope22 from the global condition named CPU speed.
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.
PS C:\> $CMGC = Get-CMGlobalCondition -Name "CPU speed"
PS C:\>Set-CMGlobalCondition -InputObject $CMGC -SecurityScopeAction RemoveMembership -SecurityScopeName "Scope22"