Edit

Share via


Get-CMSecurityRolePermission

Get the permissions for the specified security role.

Syntax

SearchByName (Default)

Get-CMSecurityRolePermission
    -Name <String>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

SearchById

Get-CMSecurityRolePermission
    -Id <String>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

SearchByValue

Get-CMSecurityRolePermission
    -InputObject <IResultObject>
    [-DisableWildcardHandling]
    [-ForceWildcardHandling]
    [<CommonParameters>]

Description

Use this cmdlet to get the permissions for the specified security role. For more information on security roles and permissions, see Fundamentals of role-based administration in Configuration Manager.

If your account doesn't have permissions to view security roles in the site, this cmdlet returns no results.

Note

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

Examples

Example 1: Get permissions for a specific role

This example first gets an object for the built-in security role Application author in the variable $role. It then passes that object to the Get-CMSecurityRolePermission cmdlet, and saves the list of permissions in the $rolePermission variable.

$roleName = "Application author"
$role = Get-CMSecurityRole -Name $roleName
$rolePermission = $role | Get-CMSecurityRolePermission

Example 2: View classes for a specific role

This example is similar to the previous example, but filters and sorts the results differently. It only displays the class names to which the role has permissions, and sorts the list alphabetically.

$rolePermission | Select-Object ObjectTypeDisplayName | Sort-Object -Property ObjectTypeDisplayName

Parameters

-DisableWildcardHandling

This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ForceWildcardHandling

This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

Specify the ID of the security role to get its permissions. This value is the RoleID property, for example SMS000AR for the OS Deployment Manager role.

To view all roles and IDs for the site, use the following command:

Get-CMSecurityRole | Select-Object RoleID, RoleName

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:RoleId

Parameter sets

SearchById
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Specify a security role object to get its permissions. To get this object, use the Get-CMSecurityRole cmdlet.

Parameter properties

Type:IResultObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SecurityRole

Parameter sets

SearchByValue
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specify the name of the security role to get its permissions.

Parameter properties

Type:String
Default value:None
Supports wildcards:True
DontShow:False
Aliases:RoleName

Parameter sets

SearchByName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.ConfigurationManagement.ManagementProvider.IResultObject

Outputs

IResultObject

IResultObject

Notes

The return object is the RoleOperation class, which includes an instance of the SMS_ARoleOperation class. For more information, see SMS_ARoleOperation server WMI class.