azure-docs-powershell-azuread/azureadps-2.0/AzureAD/Enable-AzureADDirectoryRole.md

124 строки
3.2 KiB
Markdown
Исходник Обычный вид История

2017-07-28 02:58:33 +03:00
---
2016-12-01 20:36:07 +03:00
external help file: Microsoft.Open.AzureAD16.Graph.PowerShell.dll-Help.xml
2020-09-18 18:44:11 +03:00
Module Name: AzureAD
online version:
2016-10-19 02:19:16 +03:00
schema: 2.0.0
---
# Enable-AzureADDirectoryRole
## SYNOPSIS
2016-12-01 20:36:07 +03:00
Activates an existing directory role in Azure Active Directory.
2016-10-19 02:19:16 +03:00
## SYNTAX
```
2017-04-20 07:03:36 +03:00
Enable-AzureADDirectoryRole [-InformationAction <ActionPreference>] [-InformationVariable <String>]
2020-09-18 18:44:11 +03:00
[-RoleTemplateId <String>] [<CommonParameters>]
2016-10-19 02:19:16 +03:00
```
## DESCRIPTION
2020-09-18 18:44:11 +03:00
The Enable-AzureADDirectoryRole cmdlet activates an existing directory role in Azure Active Directory.
2016-10-19 02:19:16 +03:00
## EXAMPLES
2016-12-05 23:34:40 +03:00
### Example 1: Enable a directory role
```
2020-09-18 18:44:11 +03:00
# Retrieve the Template Role object for the Guest Inviter role
$InviterRole = Get-AzureADDirectoryRoleTemplate | Where-Object {$_.DisplayName -eq "Guest Inviter"}
2021-03-24 18:21:39 +03:00
# Inspect the $Inviter variable to make sure we found the correct template role
2020-09-18 18:44:11 +03:00
$InviterRole
2020-09-18 18:44:11 +03:00
ObjectId DisplayName Description
-------- ----------- -----------
95e79109-95c0-4d8e-aee3-d01accf2d47b Guest Inviter Guest Inviter has access to invite guest users.
# Enable the Inviter Role
Enable-AzureADDirectoryRole -RoleTemplateId $InviterRole.ObjectId
ObjectId DisplayName Description
-------- ----------- -----------
03618579-3c16-4765-9539-86d9163ee3d9 Guest Inviter Guest Inviter has access to invite guest users.
2016-12-05 23:34:40 +03:00
```
2020-09-18 18:44:11 +03:00
The first command gets an inviter role that has the display name Guest Inviter by using the Get-AzureADDirectoryRoleTemplate (./Get-AzureADDirectoryRoleTemplate.md)cmdlet.
The command stores Guest Inviter in the $InviterRole variable.
2016-12-05 23:34:40 +03:00
2020-09-18 18:44:11 +03:00
The second command displays the contents of $InviterRole.
The final command enables the directory role in $InviterRole.
2016-12-05 23:34:40 +03:00
## PARAMETERS
2016-12-01 20:36:07 +03:00
### -InformationAction
2020-09-18 18:44:11 +03:00
Specifies how this cmdlet responds to an information event.
The acceptable values for this parameter are:
2016-12-01 20:36:07 +03:00
- Continue
- Ignore
- Inquire
- SilentlyContinue
- Stop
- Suspend
```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases: infa
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -InformationVariable
Specifies a variable in which to store an information event message.
```yaml
Type: String
Parameter Sets: (All)
Aliases: iv
Required: False
Position: Named
Default value: None
Accept pipeline input: False
2016-10-19 02:19:16 +03:00
Accept wildcard characters: False
```
2017-04-20 07:03:36 +03:00
### -RoleTemplateId
2017-04-20 07:48:02 +03:00
The ID of the Role template to enable
2017-04-20 07:03:36 +03:00
```yaml
Type: String
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2017-04-20 07:03:36 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2016-12-01 20:36:07 +03:00
### CommonParameters
2020-09-18 18:44:11 +03:00
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
2016-12-01 20:36:07 +03:00
2023-12-18 01:29:36 +03:00
## NOTES
See the [migration guide for Enable-AzureADDirectoryRole](./migrate/Enable-AzureADDirectoryRole.md) to the Microsoft Graph PowerShell.
2016-10-19 02:19:16 +03:00
## INPUTS
## OUTPUTS
## RELATED LINKS
2023-12-18 01:29:36 +03:00
[Get-AzureADDirectoryRole](Get-AzureADDirectoryRole.md)
2020-09-18 18:44:11 +03:00
2023-12-18 01:29:36 +03:00
[Get-AzureADDirectoryRoleTemplate](Get-AzureADDirectoryRoleTemplate.md)
2016-12-01 20:36:07 +03:00