Get-CMSecurityRole

Get security roles.

Syntax

Get-CMSecurityRole
   [-Name <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [<CommonParameters>]
Get-CMSecurityRole
   -Id <String>
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [<CommonParameters>]

Description

Use this cmdlet to get one or more security roles from the Configuration Manager site. 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 all security roles

This example lists all roles and IDs for the site.

Get-CMSecurityRole | Select-Object RoleID, RoleName

Example 2: Get a security role by using a wildcard

This command gets all security roles that have a name that starts with App.

Get-CMSecurityRole -Name "App*"

Example 3: List all custom security roles

This command returns all security roles that aren't built-in.

Get-CMSecurityRole | Where-Object { $_.IsBuiltIn -eq $false }

Parameters

-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

-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

-Id

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

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

-Name

Specify the name of the security role to get.

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

Inputs

None

Outputs

IResultObject[]

IResultObject

Notes

For more information on this return object and its properties, see SMS_Role server WMI class.