Add-CMObjectSecurityScope

Adds a security scope to an object.

Syntax

Add-CMObjectSecurityScope
   [-Confirm]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   -Id <String>
   -InputObject <IResultObject[]>
   [-WhatIf]
   [<CommonParameters>]
Add-CMObjectSecurityScope [-Name]  [-Confirm] [-DisableWildcardHandling] [-ForceWildcardHandling]
 -InputObject  [-WhatIf] []
Add-CMObjectSecurityScope [-Scope]  [-Confirm] [-DisableWildcardHandling]
 [-ForceWildcardHandling] -InputObject  [-WhatIf] []

Description

The Add-CMObjectSecurityScope cmdlet adds security scope to a Microsoft System Center Configuration Manager object.

Examples

Example 1: Add a security scope to application objects by using the pipeline

PS C:\> $Scope = New-CMSecurityScope -Name "Scope1" -Description "Security scope 1"
PS C:\> Get-CMApplication -Name "Application*" | Add-CMObjectSecurityScope -Scope $Scope

The first command creates a security scope object named Scope1 and stores the object in the $Scope variable.

The second command gets all application objects that have a name beginning with "Application" and uses the pipeline operator to pass the objects to Add-CMObjectSecurityScope. Add-CMObjectSecurityScope adds the security scope stored in $Scope to each application object.

Example 2: Add a security scope to application objects

PS C:\>Add-CMObjectSecurityScope -Name "Scope1" -InputObject (Get-CMApplication -Name "Application*")

This command gets all application objects that have a name beginning with "Application" and then adds the security scope named Scope1 to each application object.

Required Parameters

-Id

Specifies the ID of a security scope.

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

Specifies an array of objects to which you want to assign a security scope.

Type:IResultObject[]
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of a security scope that this cmdlet adds. A security scope name can be Default or the name of a custom security scope.

Type:String
Aliases:SecurityScopeName
Required:True
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Scope

Specifies an array of security scopes.

Type:IResultObject[]
Aliases:SecurityScope, SecuredCategory, Scopes, SecurityScopes, SecuredCategories
Required:True
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

Indicates that wildcard handling is disabled.

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

Indicates that wildcard handling is enabled.

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