Teams Scan Process¶
This guide explains how to use the tools/teams scanner to export Teams structure, channel messages/replies, and optional files into JSON.
1) Install¶
cd tools/teams
pip install -r requirements.txt
2) List Joined Teams¶
BROWSER=google-chrome python scripts/scan-teams-graph.py --list-teams
3) Scan Teams + Channels Structure Only¶
BROWSER=google-chrome python scripts/scan-teams-graph.py -o analyses/teams-structure.json
4) Include Channel Messages and Reply Threads¶
BROWSER=google-chrome python scripts/scan-teams-graph.py --include-channel-messages --message-limit 50 --reply-limit 50 -o analyses/teams-messages.json
5) Skip Reply Threads¶
BROWSER=google-chrome python scripts/scan-teams-graph.py --include-channel-messages --skip-channel-replies -o analyses/teams-no-replies.json
6) Download Channel Files and Include in JSON¶
BROWSER=google-chrome python scripts/scan-teams-graph.py --include-channel-messages --download-channel-files --max-channel-files 25 -o analyses/teams-full-scan.json
7) Operator Notes¶
- First run requires Microsoft interactive authentication.
- Prefer Chrome by setting
BROWSER=google-chrome. - Start with low limits to validate permissions and scope.
- Save outputs under
tools/teams/analyses/.
8) Target a Specific Team, Channel, or Chat Text¶
Filter by team name¶
BROWSER=google-chrome python scripts/scan-teams-graph.py --team-name "OVES All" -o analyses/team-filtered.json
Filter by channel name within a team¶
BROWSER=google-chrome python scripts/scan-teams-graph.py --team-name "OVES All" --channel-name "General" -o analyses/channel-filtered.json
Search for chat messages containing specific text¶
BROWSER=google-chrome python scripts/scan-teams-graph.py --team-name "Product Team" --channel-name "General" --include-channel-messages --message-contains "invoice approval" -o analyses/message-search.json
Matching behavior (case/spacing/fuzzy)¶
- Name and text matching is case-insensitive.
- Spacing/punctuation differences are tolerated (e.g.
NewManagerAssimilationcan matchNew Manager Assimilation). - Near matches are supported for minor typos.
9) Microsoft Forms links in a channel¶
When form links are posted in a channel, keep only parent messages whose body contains forms.office.com or forms.microsoft.com:
BROWSER=google-chrome python scripts/scan-teams-graph.py \
--team-name "OVES All" \
--channel-name "General" \
--include-channel-messages \
--forms-links-only \
--message-limit 100 \
--reply-limit 30 \
-o analyses/channel-forms-posts.json
See Forms links in Teams for the full guide.