remove_group_member
async
¶
remove_group_member(
directory_id: DirectoryId,
group_name: GroupName,
member_name: MemberName,
*,
config_overrides: Optional[AsyncDirectoryServiceDataClientConfig] = None,
member_realm: Optional[Realm] = None,
client_token: Optional[ClientToken] = None,
) -> RemoveGroupMemberResult
Removes a member from a group.
Parameters:
-
directory_id(DirectoryId) –The identifier (ID) of the directory that's associated with the member.
-
group_name(GroupName) –The name of the group.
-
member_name(MemberName) –The
SAMAccountNameof the user, group, or computer to remove from the group. -
member_realm(Optional[Realm], default:None) –The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.
This parameter is optional and case insensitive.
-
client_token(Optional[ClientToken], default:None) –A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.
A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.
If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an
ConflictException.This parameter is optional when using the CLI or SDK.
Raises:
-
AccessDeniedException–You don't have permission to perform the request or access the directory. It can also occur when the
DirectoryIddoesn't exist or the user, member, or group might be outside of your organizational unit (OU).Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.
-
ConflictException–This error will occur when you try to create a resource that conflicts with an existing object. It can also occur when adding a member to a group that the member is already in.
This error can be caused by a request sent within the 8-hour idempotency window with the same client token but different input parameters. Client tokens should not be re-used across different requests. After 8 hours, any request with the same client token is treated as a new request.
-
DirectoryUnavailableException–The request could not be completed due to a problem in the configuration or current state of the specified directory.
-
InternalServerException–The operation didn't succeed because an internal error occurred. Try again later.
-
ResourceNotFoundException–The resource couldn't be found.
-
ThrottlingException–The limit on the number of requests per second has been exceeded.
-
ValidationException–The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To remove a member from a group The following command removes the specified member from the example.local domain.
>>> await client.remove_group_member(client_token='550e8400-e29b-41d4-a716-446655440000', directory_id='d-12233abcde', group_name='DevOps', member_name='Pat Candella', member_realm='example.local')
Source code in docs_src/capo_directory_service_data/_services/async_directory_service_data.py
1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 | |