Group

class O365.groups.Group(*, parent=None, con=None, **kwargs)[source]

Bases: ApiComponent

A Microsoft O365 group

__init__(*, parent=None, con=None, **kwargs)[source]

A Microsoft O365 group

Parameters:
  • parent (Teams) – parent object

  • con (Connection) – connection to use if no parent specified

  • protocol (Protocol) – protocol to use if no parent specified (kwargs)

  • main_resource (str) – use this resource instead of parent resource (kwargs)

get_group_members(recursive=False)[source]

Returns members of given group :param bool recursive: drill down to users if group has other group as a member :rtype: list[User]

get_group_owners()[source]

Returns owners of given group

Return type:

list[User]

description

An optional description for the group.

   Type: str

display_name

The display name for the group.

   Type: str

mail

The SMTP address for the group, for example, “serviceadmins@contoso.com”.

   Type: str

mail_nickname

The mail alias for the group, unique for Microsoft 365 groups in the organization.

   Type: str

object_id

The unique identifier for the group.

   Type: str

type

The group type.

   Type: str

visibility

Specifies the group join policy and group content visibility for groups.

   Type: str

class O365.groups.Groups(*, parent=None, con=None, **kwargs)[source]

Bases: ApiComponent

A microsoft groups class In order to use the API following permissions are required. Delegated (work or school account) - Group.Read.All, Group.ReadWrite.All

__init__(*, parent=None, con=None, **kwargs)[source]

A Teams object

Parameters:
  • parent (Account) – parent object

  • con (Connection) – connection to use if no parent specified

  • protocol (Protocol) – protocol to use if no parent specified (kwargs)

  • main_resource (str) – use this resource instead of parent resource (kwargs)

get_group_by_id(group_id=None)[source]

Returns Microsoft O365/AD group with given id

Parameters:

group_id – group id of group

Return type:

Group

get_group_by_mail(group_mail=None)[source]

Returns Microsoft O365/AD group by mail field

Parameters:

group_name – mail of group

Return type:

Group

get_user_groups(user_id=None)[source]

Returns list of groups that given user has membership

Parameters:

user_id – user_id

Return type:

list[Group]

list_groups()[source]

Returns list of groups

Return type:

list[Group]