Get-CMSecurityRole
Get security roles.
Syntax
SearchByName (Default)
Get-CMSecurityRole
[-Name <String>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
SearchByIdMandatory
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.
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. This value is the RoleID
property, for example SMS000AR
for the OS Deployment Manager role.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | RoleId |
Parameter sets
SearchByIdMandatory
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Name
Specify the name of the security role to get.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | True |
DontShow: | False |
Aliases: | RoleName |
Parameter sets
SearchByName
Position: | Named |
Mandatory: | False |
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
None
Outputs
IResultObject
IResultObject
Notes
For more information on this return object and its properties, see SMS_Role server WMI class.