GroupsOperations Class

GroupsOperations operations.

Inheritance
builtins.object
GroupsOperations

Constructor

GroupsOperations(client, config, serializer, deserializer)

Parameters

Name Description
client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

Name Description
api_version

Client API version. Constant value: "1.6".

Methods

add_member

Add a member to a group.

add_owner

Add an owner to a group.

create

Create a group in the directory.

delete

Delete a group from the directory.

get

Gets group information from the directory.

get_group_members

Gets the members of a group.

get_member_groups

Gets a collection of object IDs of groups of which the specified group is a member.

is_member_of

Checks whether the specified user, group, contact, or service principal is a direct or transitive member of the specified group.

list

Gets list of groups for the current tenant.

list_owners

Directory objects that are owners of the group.

The owners are a set of non-admin users who are allowed to modify this object.

remove_member

Remove a member from a group.

remove_owner

Remove a member from owners.

add_member

Add a member to a group.

add_member(group_object_id, url, additional_properties=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
group_object_id
Required
str

The object ID of the group to which to add the member.

url
Required
str

A member object URL, such as "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd", where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the member (user, application, servicePrincipal, group) to be added.

additional_properties

Unmatched properties from the message are deserialized this collection

default value: None
custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

add_owner

Add an owner to a group.

add_owner(object_id, url, additional_properties=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the application to which to add the owner.

url
Required
str

A owner object URL, such as "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd", where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the owner (user, application, servicePrincipal, group) to be added.

additional_properties

Unmatched properties from the message are deserialized this collection

default value: None
custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

create

Create a group in the directory.

create(parameters, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
parameters
Required

The parameters for the group to create.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

ADGroup or ClientRawResponse if raw=true

Exceptions

Type Description

delete

Delete a group from the directory.

delete(object_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the group to delete.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

get

Gets group information from the directory.

get(object_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the user for which to get group information.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

ADGroup or ClientRawResponse if raw=true

Exceptions

Type Description

get_group_members

Gets the members of a group.

get_group_members(object_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the group whose members should be retrieved.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description

An iterator like instance of DirectoryObject

Exceptions

Type Description

get_member_groups

Gets a collection of object IDs of groups of which the specified group is a member.

get_member_groups(object_id, security_enabled_only, additional_properties=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the group for which to get group membership.

security_enabled_only
Required

If true, only membership in security-enabled groups should be checked. Otherwise, membership in all groups should be checked.

additional_properties

Unmatched properties from the message are deserialized this collection

default value: None
custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description

An iterator like instance of str

Exceptions

Type Description

is_member_of

Checks whether the specified user, group, contact, or service principal is a direct or transitive member of the specified group.

is_member_of(parameters, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
parameters
Required

The check group membership parameters.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
<xref:msrest.pipeline.ClientRawResponse>

CheckGroupMembershipResult or ClientRawResponse if raw=true

Exceptions

Type Description

list

Gets list of groups for the current tenant.

list(filter=None, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
filter
str

The filter to apply to the operation.

default value: None
custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description

An iterator like instance of ADGroup

Exceptions

Type Description

list_owners

Directory objects that are owners of the group.

The owners are a set of non-admin users who are allowed to modify this object.

list_owners(object_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the group for which to get owners.

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description

An iterator like instance of DirectoryObject

Exceptions

Type Description

remove_member

Remove a member from a group.

remove_member(group_object_id, member_object_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
group_object_id
Required
str

The object ID of the group from which to remove the member.

member_object_id
Required
str

Member object id

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

remove_owner

Remove a member from owners.

remove_owner(object_id, owner_object_id, custom_headers=None, raw=False, **operation_config)

Parameters

Name Description
object_id
Required
str

The object ID of the group from which to remove the owner.

owner_object_id
Required
str

Owner object id

custom_headers

headers that will be added to the request

default value: None
raw

returns the direct response alongside the deserialized response

default value: False
operation_config
Required

Operation configuration overrides.

Returns

Type Description
None,
<xref:msrest.pipeline.ClientRawResponse>

None or ClientRawResponse if raw=true

Exceptions

Type Description

Attributes

models

models = <module 'azure.graphrbac.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\graphrbac\\models\\__init__.py'>