forked from vgrem/office365-rest-python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist_all.py
More file actions
15 lines (12 loc) · 645 Bytes
/
Copy pathlist_all.py
File metadata and controls
15 lines (12 loc) · 645 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""
List all teams in an organization (tenant)
https://learn.microsoft.com/en-us/graph/teams-list-all-teams?context=graph%2Fapi%2F1.0&view=graph-rest-1.0
"""
from office365.graph_client import GraphClient
from tests.graph_case import acquire_token_by_client_credentials
client = GraphClient(acquire_token_by_client_credentials)
# teams = client.teams.get_all().select(["displayName"]).execute_query() # get all at once
# teams = client.teams.get().paged().select(["displayName"]).execute_query() # paged load
teams = client.teams.get().top(10).select(["displayName"]).execute_query()
for team in teams:
print("Name: {0}".format(team))