search_groups
¶
search_groups(
directory_id: DirectoryId,
search_string: SearchString,
search_attributes: LdapDisplayNameList,
*,
config_overrides: Optional[DirectoryServiceDataClientConfig] = None,
realm: Optional[Realm] = None,
next_token: Optional[NextToken] = None,
max_results: Optional[MaxResults] = None,
) -> SearchGroupsResult
Searches the specified directory for a group. You can find groups that match the SearchString parameter with the value of their attributes included in the SearchString parameter.
This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the SearchGroups.NextToken member contains a token that you pass in the next call to SearchGroups. This retrieves the next set of items.
You can also specify a maximum number of return results with the MaxResults parameter.
Parameters:
-
directory_id(DirectoryId) –The identifier (ID) of the directory that's associated with the group.
-
search_string(SearchString) –The attribute value that you want to search for.
Wildcard
(*)searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes. -
search_attributes(LdapDisplayNameList) –One or more data attributes that are used to search for a group. For a list of supported attributes, see Directory Service Data Attributes.
-
realm(Optional[Realm], default:None) –The domain name that's associated with the group.
This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.
This value is case insensitive.
-
next_token(Optional[NextToken], default:None) –An encoded paging token for paginated calls that can be passed back to retrieve the next page.
-
max_results(Optional[MaxResults], default:None) –The maximum number of results to be returned per request.
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.
-
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.
-
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 search for groups The following command searches the examplecorp.com domain for groups with the GroupType security.
>>> client.search_groups(directory_id='d-12233abcde', max_results=123, next_token='123456', realm='examplecorp.com', search_attributes=['GroupScope'], search_string='Security')
Source code in docs_src/capo_directory_service_data/_services/directory_service_data.py
1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 | |