Enable-AzureADDirectoryRole

Activates an existing directory role in Azure Active Directory.

Syntax

Enable-AzureADDirectoryRole
      [-InformationAction <ActionPreference>]
      [-InformationVariable <String>]
      [-DirectoryRole <String>]
      [<CommonParameters>]

Description

The Enable-AzureADDirectoryRole cmdlet activates an existing directory role in Azure Active Directory.

Examples

Example 1: Enable a directory role

# Get Guest Inviter directory role template
$roleTemplate = Get-AzureADDirectoryRoleTemplate | ? { $_.DisplayName -eq "Guest Inviter" }

# Enable an instance of the DirectoryRole template
Enable-AzureADDirectoryRole -RoleTemplateId $roleTemplate.ObjectId

The first command gets an inviter role that has the display name Guest Inviter by using the Get-AzureADDirectoryRoleTemplate cmdlet. The command stores Guest Inviter in the $roleTemplate variable.

The second command instantiates an instance of the directory role in $roleTemplate.

Optional Parameters

-InformationAction

Specifies how this cmdlet responds to an information event. The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
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.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RoleTemplateId

The ID of the Role template to enable

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False