Editar

Compartilhar via


New-AzADGroupOwner

Create new navigation property ref to owners for groups

Syntax

New-AzADGroupOwner
   -GroupId <String>
   -OwnerId <String>
   [-DefaultProfile <PSObject>]
   [-PassThru]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Create new navigation property ref to owners for groups

Examples

Example 1: Assign a user as owner of a group

$userId = (Get-AzADUser -DisplayName "John Doe").Id
$groupId = (Get-AzADGroup -DisplayName "someGroup").Id
New-AzADGroupOwner -GroupId $groupId -OwnerId $userId

Assign a user as owner of a group

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GroupId

The unique identifier of group

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

-OwnerId

.

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

-PassThru

Returns true when the command succeeds

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Boolean