|
| 1 | +--- |
| 2 | +external help file: Microsoft.Azure.Commands.Resources.dll-Help.xml |
| 3 | +Module Name: AzureRM.Resources |
| 4 | +online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.resources/add-azurermadgroupmember |
| 5 | +schema: 2.0.0 |
| 6 | +--- |
| 7 | + |
| 8 | +# Add-AzureRmADGroupMember |
| 9 | + |
| 10 | +## SYNOPSIS |
| 11 | +Adds a user to an existing AD group. |
| 12 | + |
| 13 | +## SYNTAX |
| 14 | + |
| 15 | +### ExplicitParameterSet (Default) |
| 16 | +``` |
| 17 | +Add-AzureRmADGroupMember -MemberObjectId <Guid> -GroupObjectId <Guid> [-PassThru] |
| 18 | + [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>] |
| 19 | +``` |
| 20 | + |
| 21 | +### GroupObjectParameterSet |
| 22 | +``` |
| 23 | +Add-AzureRmADGroupMember -MemberObjectId <Guid> -GroupObject <PSADGroup> [-PassThru] |
| 24 | + [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>] |
| 25 | +``` |
| 26 | + |
| 27 | +## DESCRIPTION |
| 28 | +Adds a user to an existing AD group. |
| 29 | + |
| 30 | +## EXAMPLES |
| 31 | + |
| 32 | +### Example 1 - Add a user to a group by object id |
| 33 | + |
| 34 | +``` |
| 35 | +PS C:\> Add-AzureRmADGroupMember -MemberObjectId D9076BBC-D62C-4105-9C78-A7F5BC4A3405 -GroupObjectId 85F89C90-780E-4AA6-9F4F-6F268D322EEE |
| 36 | +``` |
| 37 | + |
| 38 | +Adds the user with object id 'D9076BBC-D62C-4105-9C78-A7F5BC4A3405' to the group with object id '85F89C90-780E-4AA6-9F4F-6F268D322EEE'. |
| 39 | + |
| 40 | +### Example 2 - Add a user to a group by piping |
| 41 | + |
| 42 | +``` |
| 43 | +PS C:\> Get-AzureRmADGroup -ObjectId 85F89C90-780E-4AA6-9F4F-6F268D322EEE | Add-AzureRmADGroupMember -MemberObjectId D9076BBC-D62C-4105-9C78-A7F5BC4A3405 |
| 44 | +``` |
| 45 | + |
| 46 | +Gets the group with object id '85F89C90-780E-4AA6-9F4F-6F268D322EEE' and pipes it to the Add-AzureRmADGroupMember cmdlet to add the user to that group. |
| 47 | + |
| 48 | +## PARAMETERS |
| 49 | + |
| 50 | +### -DefaultProfile |
| 51 | +The credentials, account, tenant, and subscription used for communication with Azure. |
| 52 | + |
| 53 | +```yaml |
| 54 | +Type: IAzureContextContainer |
| 55 | +Parameter Sets: (All) |
| 56 | +Aliases: AzureRmContext, AzureCredential |
| 57 | + |
| 58 | +Required: False |
| 59 | +Position: Named |
| 60 | +Default value: None |
| 61 | +Accept pipeline input: False |
| 62 | +Accept wildcard characters: False |
| 63 | +``` |
| 64 | +
|
| 65 | +### -GroupObject |
| 66 | +The object representation of the group to add the member to. |
| 67 | +
|
| 68 | +```yaml |
| 69 | +Type: PSADGroup |
| 70 | +Parameter Sets: GroupObjectParameterSet |
| 71 | +Aliases: |
| 72 | + |
| 73 | +Required: True |
| 74 | +Position: Named |
| 75 | +Default value: None |
| 76 | +Accept pipeline input: True (ByValue) |
| 77 | +Accept wildcard characters: False |
| 78 | +``` |
| 79 | +
|
| 80 | +### -GroupObjectId |
| 81 | +The object id of the group to add the member to. |
| 82 | +
|
| 83 | +```yaml |
| 84 | +Type: Guid |
| 85 | +Parameter Sets: ExplicitParameterSet |
| 86 | +Aliases: |
| 87 | + |
| 88 | +Required: True |
| 89 | +Position: Named |
| 90 | +Default value: None |
| 91 | +Accept pipeline input: True (ByPropertyName) |
| 92 | +Accept wildcard characters: False |
| 93 | +``` |
| 94 | +
|
| 95 | +### -MemberObjectId |
| 96 | +The object id of the member. |
| 97 | +
|
| 98 | +```yaml |
| 99 | +Type: Guid |
| 100 | +Parameter Sets: ExplicitParameterSet |
| 101 | +Aliases: |
| 102 | + |
| 103 | +Required: True |
| 104 | +Position: Named |
| 105 | +Default value: None |
| 106 | +Accept pipeline input: True (ByPropertyName) |
| 107 | +Accept wildcard characters: False |
| 108 | +``` |
| 109 | +
|
| 110 | +```yaml |
| 111 | +Type: Guid |
| 112 | +Parameter Sets: GroupObjectParameterSet |
| 113 | +Aliases: |
| 114 | + |
| 115 | +Required: True |
| 116 | +Position: Named |
| 117 | +Default value: None |
| 118 | +Accept pipeline input: True (ByPropertyName) |
| 119 | +Accept wildcard characters: False |
| 120 | +``` |
| 121 | +
|
| 122 | +### -PassThru |
| 123 | +Specifying this will return true if the command was successful. |
| 124 | +
|
| 125 | +```yaml |
| 126 | +Type: SwitchParameter |
| 127 | +Parameter Sets: (All) |
| 128 | +Aliases: |
| 129 | + |
| 130 | +Required: True |
| 131 | +Position: Named |
| 132 | +Default value: None |
| 133 | +Accept pipeline input: False |
| 134 | +Accept wildcard characters: False |
| 135 | +``` |
| 136 | +
|
| 137 | +### -Confirm |
| 138 | +Prompts you for confirmation before running the cmdlet. |
| 139 | +
|
| 140 | +```yaml |
| 141 | +Type: SwitchParameter |
| 142 | +Parameter Sets: (All) |
| 143 | +Aliases: cf |
| 144 | + |
| 145 | +Required: False |
| 146 | +Position: Named |
| 147 | +Default value: None |
| 148 | +Accept pipeline input: False |
| 149 | +Accept wildcard characters: False |
| 150 | +``` |
| 151 | +
|
| 152 | +### -WhatIf |
| 153 | +Shows what would happen if the cmdlet runs. |
| 154 | +The cmdlet is not run. |
| 155 | +
|
| 156 | +```yaml |
| 157 | +Type: SwitchParameter |
| 158 | +Parameter Sets: (All) |
| 159 | +Aliases: wi |
| 160 | + |
| 161 | +Required: False |
| 162 | +Position: Named |
| 163 | +Default value: None |
| 164 | +Accept pipeline input: False |
| 165 | +Accept wildcard characters: False |
| 166 | +``` |
| 167 | +
|
| 168 | +### CommonParameters |
| 169 | +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). |
| 170 | +
|
| 171 | +## INPUTS |
| 172 | +
|
| 173 | +### Microsoft.Azure.Graph.RBAC.Version1_6.ActiveDirectory.PSADGroup |
| 174 | +
|
| 175 | +This cmdlet accepts a PSADGroup object from the pipeline. You can pipe the output of Get-AzureRmADGroup to this cmdlet to get members of the provided group. |
| 176 | +
|
| 177 | +## OUTPUTS |
| 178 | +
|
| 179 | +### System.Boolean |
| 180 | +
|
| 181 | +## NOTES |
| 182 | +
|
| 183 | +## RELATED LINKS |
0 commit comments