Remove-AzADGroupOwner
Delete ref of navigation property owners for groups
Syntax
Remove-AzADGroupOwner
-GroupId <String>
-OwnerId <String>
[-DefaultProfile <PSObject>]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Delete ref of navigation property owners for groups
Examples
Example 1: Unassign an owner for a group
$groupId = (Get-AzADGroup -DisplayName "someGroup").Id
$ownerId = (Get-AzADGroupOwner -GroupId $groupId)[0].Id
Remove-AzADGroupOwner -GroupId $groupId -OwnerId $ownerId
Unassign an owner for a group. Notice: 1.this cmdlet does not delete the owner directory object. 2.a group does not have a onwer by default, but has to have at least one owner once had one.
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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
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
The unique identifier of directoryObject
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 |