Get-DSRole

Synopsis

Fetch one or more existing roles.

Syntax

GetPage (Default)

Get-DSRole [-PageNumber <int>] [-PageSize <int>] [-AsLegacyResponse] [<CommonParameters>]

GetAll

Get-DSRole -All [-AsLegacyResponse] [<CommonParameters>]

GetByID

Get-DSRole -RoleID <guid> [-AsLegacyResponse] [<CommonParameters>]

Description

Fetch one or more existing roles. Three alternative methods are possible: all roles, a single one or a page of roles.

Examples

Example 1

PS C:\> Get-DSRole -All

Get all the roles

Example 2

PS C:\> Get-DSRole -RoleID $roleID

Get a specific role

Example 3

PS C:\> Get-DSRole -PageNumber 1 -PageSize 10

Get the first page containing 10 roles

Parameters

-All

All roles will be fetched.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- GetAll
ParameterSets:
- Name: GetAll
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-AsLegacyResponse

In versions prior to 2024.2, many DS cmdlets returned a ServerResponse object. Enabling this backward compatibility switch allows scripts developed for earlier versions to function correctly.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-PageNumber

Specify the page of roles fetched. First page is fetched by default.

Type: System.Int32
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: GetPage
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-PageSize

Number of roles per page. 10 roles per page by default.

Type: System.Int32
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: GetPage
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-RoleID

Type: System.Guid
DefaultValue: ''
SupportsWildcards: false
Aliases:
- Id
ParameterSets:
- Name: GetByID
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

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.

Notes

For more information, type "Get-Help Get-DSRole -detailed". For technical information, type "Get-Help Get-DSRole -full".

Devolutions Forum logo Give us Feedback