[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-77274":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":14,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":14,"starSnapshotCount":14,"syncStatus":24,"lastSyncTime":25,"discoverSource":26},77274,"teams-policy-export","disintegr8te\u002Fteams-policy-export","disintegr8te","PowerShell tool to export Microsoft Teams policies and generate stakeholder decision workbooks",null,"PowerShell",102,10,117,0,3.12,"Apache License 2.0",false,"main",true,[],"2026-06-12 02:03:42","# Teams Policy Export Tool\n\nA PowerShell tool that exports your Microsoft Teams policies and configurations into structured files (JSON, CSV) and a formatted Excel workbook designed for stakeholder decision meetings.\n\n**In plain terms:** This tool connects to your Microsoft 365 tenant, reads every Teams policy setting, and produces a spreadsheet that shows what is configured, what the recommended settings are, where your settings differ from recommendations, how many users are affected, and gives you columns to record decisions in meetings.\n\n---\n\n## Table of Contents\n\n- [Prerequisites](#prerequisites)\n- [Quick Start](#quick-start)\n- [Parameters Reference](#parameters-reference)\n- [Output Structure](#output-structure)\n- [Understanding the Excel Report](#understanding-the-excel-report)\n- [Troubleshooting](#troubleshooting)\n- [Architecture Overview](#architecture-overview)\n- [Further Reading](#further-reading)\n\n---\n\n## Prerequisites\n\n### Software\n\n| Requirement | Version | Why |\n|---|---|---|\n| PowerShell | 5.1 (Windows) or 7.2+ (cross-platform) | Runs the script |\n| MicrosoftTeams module | Latest from PowerShell Gallery | Connects to Teams and reads policies |\n| ImportExcel module | Latest from PowerShell Gallery | Generates the Excel workbook (not needed if you use `-SkipExcel`) |\n\n### Permissions\n\nYou need **Teams Administrator** or **Global Administrator** rights in your Microsoft 365 tenant. If you only need to read policies (no user assignments), Teams Administrator is sufficient.\n\n### Install the Required Modules\n\nOpen a PowerShell window and run:\n\n```powershell\nInstall-Module MicrosoftTeams -Scope CurrentUser -Force -AllowClobber\nInstall-Module ImportExcel    -Scope CurrentUser -Force\n```\n\nTo verify they are installed:\n\n```powershell\nGet-Module -ListAvailable -Name MicrosoftTeams\nGet-Module -ListAvailable -Name ImportExcel\n```\n\nBoth commands should return version information. If either returns nothing, the install did not work -- re-run the `Install-Module` command.\n\n---\n\n## Quick Start\n\n### Step 1: Open PowerShell\n\nOpen a PowerShell window. Navigate to the folder where you cloned or unzipped this tool:\n\n```powershell\ncd C:\\path\\to\\teamsexport\n```\n\n### Step 2: Run the Basic Export\n\n```powershell\n.\\Export-TeamsPolicies.ps1\n```\n\nA browser window will pop up asking you to sign in. Use your admin account. The script will:\n\n1. Connect to Microsoft Teams\n2. Discover all available policy cmdlets (typically 70-80)\n3. Export each one to JSON and CSV\n4. Generate the Excel workbook\n5. Disconnect from Teams\n\n### Step 3: Find Your Output\n\nWhen the script finishes, it prints the output path. Look for a folder named like:\n\n```\nTeams-Policy-Export-20260415-093000\u002F\n```\n\nOpen `TeamsPolicies.xlsx` inside that folder.\n\n### Step 4: If You Are on a Remote\u002FSSH Session\n\nIf you cannot open a browser (headless server, SSH session), use device code authentication:\n\n```powershell\n.\\Export-TeamsPolicies.ps1 -AuthMethod DeviceCode\n```\n\nThe script will display a code and a URL. Open https:\u002F\u002Fmicrosoft.com\u002Fdevicelogin on any device, enter the code, and sign in there.\n\n---\n\n## Parameters Reference\n\n### `-OutDir` (string)\n\nWhere to save the output. Defaults to a timestamped folder in the current directory.\n\n```powershell\n# Save to a specific location\n.\\Export-TeamsPolicies.ps1 -OutDir C:\\Exports\\TeamsReview\n\n# Default behavior creates: .\\Teams-Policy-Export-20260415-093000\\\n.\\Export-TeamsPolicies.ps1\n```\n\n### `-IncludeAssignments` (switch)\n\nAdds per-user and group-based policy assignment data. This shows which users have which policies assigned, enabling the user impact analysis in the Excel report.\n\n**Note:** This queries every user in the tenant, which can take several minutes for large organizations.\n\n```powershell\n.\\Export-TeamsPolicies.ps1 -IncludeAssignments\n```\n\n### `-UserResultSize` (integer, default: 500000)\n\nMaximum number of users to retrieve when `-IncludeAssignments` is used. You rarely need to change this unless your tenant has more than 500,000 users.\n\n```powershell\n.\\Export-TeamsPolicies.ps1 -IncludeAssignments -UserResultSize 100000\n```\n\n### `-BatchSize` (integer, default: 5000)\n\nHow many users to process at a time in memory. Lower values use less memory but take longer. Increase if you have plenty of RAM and want faster processing.\n\n```powershell\n# Lower memory usage (slower)\n.\\Export-TeamsPolicies.ps1 -IncludeAssignments -BatchSize 1000\n\n# Higher throughput (more memory)\n.\\Export-TeamsPolicies.ps1 -IncludeAssignments -BatchSize 10000\n```\n\n### `-DefaultsOnly` (switch)\n\nExports only the Global (org-wide default) policy row for each cmdlet. Useful for creating a baseline snapshot without all the custom policy tiers.\n\n```powershell\n.\\Export-TeamsPolicies.ps1 -DefaultsOnly\n```\n\n### `-SkipExcel` (switch)\n\nProduces only the raw JSON and CSV files without generating the Excel workbook. Useful if you just need the data for another tool or script.\n\n```powershell\n.\\Export-TeamsPolicies.ps1 -SkipExcel\n```\n\n### `-ExcelOnly` (switch)\n\nRegenerates the Excel workbook from an existing export directory. **Does not connect to Teams** -- works entirely from the previously exported JSON files. This is useful when you want to tweak the config files (friendly names, categories, etc.) and see the updated Excel without re-exporting.\n\nYou must pass `-OutDir` pointing to an existing export folder that contains a `manifest.csv`.\n\n```powershell\n.\\Export-TeamsPolicies.ps1 -ExcelOnly -OutDir .\\Teams-Policy-Export-20260309-143000\n```\n\n### `-AuthMethod` (string: `Interactive` or `DeviceCode`)\n\nHow to authenticate with Microsoft Teams.\n\n- **Interactive** (default): Opens a browser window for sign-in. Use this when running on your own computer.\n- **DeviceCode**: Displays a code to enter at https:\u002F\u002Fmicrosoft.com\u002Fdevicelogin. Use this for headless\u002Fremote\u002FSSH sessions.\n\n```powershell\n.\\Export-TeamsPolicies.ps1 -AuthMethod DeviceCode\n```\n\n### `-ApplyDecisions` (string: path to Excel file)\n\nReads a completed Excel workbook (with DECISION column filled in from a stakeholder meeting) and applies those decisions to the tenant's Global policies. Use with `-GenerateScript` or `-DryRun` for safety.\n\n```powershell\n# Safest: generate a reviewable script\n.\\Export-TeamsPolicies.ps1 -ApplyDecisions .\\TeamsPolicies-Decisions.xlsx -GenerateScript\n\n# Preview only (no changes made)\n.\\Export-TeamsPolicies.ps1 -ApplyDecisions .\\TeamsPolicies-Decisions.xlsx -DryRun\n\n# Direct apply (prompts for confirmation)\n.\\Export-TeamsPolicies.ps1 -ApplyDecisions .\\TeamsPolicies-Decisions.xlsx\n```\n\nSee [docs\u002FRUNBOOK.md](docs\u002FRUNBOOK.md#post-meeting-processing-decisions) for the full post-meeting workflow.\n\n### `-GenerateScript` (switch)\n\nUsed with `-ApplyDecisions`. Instead of applying changes directly, generates a standalone `.ps1` script containing all `Set-Cs*` commands. You can review, edit, and run it on your own schedule.\n\n### `-DryRun` (switch)\n\nUsed with `-ApplyDecisions`. Shows what would change without applying anything. No Teams connection needed.\n\n---\n\n## Output Structure\n\nA successful run creates a folder with this structure:\n\n```\nTeams-Policy-Export-20260415-093000\u002F\n|\n|-- TeamsPolicies.xlsx        The main deliverable -- formatted Excel workbook\n|-- manifest.csv              Inventory of everything exported (status, counts, file paths)\n|-- README.txt                Quick reference generated with each export\n|\n|-- raw-json\u002F                 Full structured JSON, one file per cmdlet\n|   |-- Get-CsTeamsMeetingPolicy.json\n|   |-- Get-CsTeamsMessagingPolicy.json\n|   |-- Get-CsTeamsCallingPolicy.json\n|   |-- UserAssignments.json          (if -IncludeAssignments was used)\n|   |-- GroupPolicyAssignments.json   (if -IncludeAssignments was used)\n|   +-- ... (one per discovered cmdlet)\n|\n+-- flat-csv\u002F                 Flattened CSV, one file per cmdlet\n    |-- Get-CsTeamsMeetingPolicy.csv\n    |-- Get-CsTeamsMessagingPolicy.csv\n    +-- ...\n```\n\n### What Each File Is For\n\n| File | When To Use It |\n|---|---|\n| `TeamsPolicies.xlsx` | Open this for meetings, reviews, and decisions. This is the primary output. |\n| `manifest.csv` | Check this if you need to verify what exported successfully and what failed. |\n| `raw-json\u002F*.json` | Use these for scripting, automation, or feeding into other tools. Contains the full object structure. |\n| `flat-csv\u002F*.csv` | Use these for quick filtering in Excel or for diff comparisons between exports. Nested objects are flattened into dot-notation columns. |\n\n---\n\n## Understanding the Excel Report\n\nThe Excel workbook contains several sheets, each designed for a different purpose.\n\n### Sheet: Overview\n\nThe first sheet you see. Provides an executive summary for the start of a meeting.\n\n**Header block** (top-left): Tenant name, export date, total users, policies exported.\n\n**Executive summary** (top-right): Key metrics at a glance:\n- **Action Items** -- settings needing a decision (drifted or high-risk without guidance). Shown in red if > 0.\n- **Already Aligned** -- settings where your current value matches the recommendation. Shown in green.\n- **High Risk** \u002F **Medium Risk** -- total counts across all categories.\n\n**Quick Links** row: Clickable hyperlinks to \"Action Required\" and \"All Decisions\" sheets.\n\n| Column | What It Shows |\n|---|---|\n| **Category** | Policy area (Meetings, Messaging, Calling & Voice, etc.) |\n| **Settings** | Total number of settings in that category |\n| **With Recommendation** | How many settings have a documented recommendation |\n| **No Recommendation** | Settings with no guidance yet -- coverage gap indicator |\n| **Drifted from Rec.** | How many settings where your current value differs from the recommendation |\n| **High Risk Settings** | Count of settings flagged as high risk |\n| **Medium Risk Settings** | Count of settings flagged as medium risk |\n| **Go To Sheet** | Clickable hyperlink to the category detail sheet |\n\n### Sheet: Action Required\n\n**Start here during the meeting.** This sheet shows only settings that need attention: drifted from recommendation, or high-risk with no recommendation. Sorted by priority (highest first).\n\n| Column | What It Shows |\n|---|---|\n| **Priority** | Computed score (0-90) combining risk level, drift, user impact, and coverage |\n| **Category** | Policy area |\n| **Setting** | Human-readable name |\n| **Risk** | High, Medium, or Low |\n| **MS Default** | Microsoft's default value |\n| **Current Global** | Your tenant's current value |\n| **Recommendation** | The recommended value |\n| **Why** | Business reasoning behind the recommendation |\n| **Users on Global** | Users affected by the Global policy value |\n| **Users on Other** | Users on custom tiers |\n| **Value Breakdown** | Per-tier value distribution with user counts |\n| **DECISION** | *Fill this in during the meeting.* |\n| **Notes** | *Meeting notes and rationale.* |\n\n### Sheet: All Decisions\n\nThe complete flat list of every policy setting across all categories. Sorted by priority (highest first). The first four columns (Priority, Risk, Setting, DECISION) are frozen so they stay visible while scrolling.\n\n| Column | What It Shows |\n|---|---|\n| **Priority** | Computed score (0-90). Hover over the header for the scoring formula. |\n| **Risk** | High, Medium, or Low based on the security impact of the setting |\n| **Setting** | Human-readable name (e.g., \"Cloud recording\" instead of `AllowCloudRecording`) |\n| **DECISION** | *Empty -- fill this in during the meeting.* Dropdowns provided for boolean and enum settings (with \"Keep\" option). |\n| **Notes** | *Empty -- add meeting notes, action items, or rationale here.* |\n| **Category** | Which policy area this setting belongs to |\n| **Current Global** | Your tenant's current value for the Global (default) policy |\n| **Recommendation** | The recommended value for your organization |\n| **Why** | Business reasoning behind the recommendation |\n| **MS Default** | Microsoft's default value (extracted from recommendations) |\n| **Changed from Default** | \"Yes\" if your current value differs from Microsoft's default |\n| **Users on Global** | How many users are on the default policy (and thus affected by the Current Global value) |\n| **Users on Other** | How many users have a custom policy assignment that overrides the Global |\n| **Value Breakdown** | Shows the value for each policy tier and how many users are on it (e.g., \"True (8,350 users) \u002F False (24 users)\") |\n| **Property** | The actual PowerShell property name |\n| **Cmdlet** | Which Teams cmdlet this comes from |\n\n### Category Detail Sheets (e.g., Meetings, Messaging, Calling & Voice)\n\nOne sheet per policy category. Similar to All Decisions but adds a column for each custom policy tier, so you can see the value side-by-side across all tiers (Global, Restricted, IT-Department, Admin, etc.).\n\n| Column | What It Shows |\n|---|---|\n| **Setting** | Human-readable setting name |\n| **Property** | PowerShell property name |\n| **Cmdlet** | Source cmdlet (with the `Get-Cs` prefix removed for brevity) |\n| **MS Default** | Microsoft's default value |\n| **Global (Current)** | Current value of the Global policy |\n| **Recommendation** | Recommended value |\n| **Risk** | High \u002F Medium \u002F Low |\n| *tier name columns* | One column per custom policy tier (e.g., \"Restricted\", \"IT-Department\"), showing that tier's value |\n| **Users on Global** | Users inheriting the Global default |\n| **Users on Other** | Users assigned to a custom tier |\n| **DECISION** | Fill in during meeting |\n| **Notes** | Meeting notes |\n\n### Sheet: User Impact\n\nShows how users are distributed across policy tiers for each policy type.\n\n| Column | What It Shows |\n|---|---|\n| **Policy Type** | The type of policy (e.g., TeamsMeetingPolicy) |\n| **Policy Name** | The specific tier (Global, Restricted, IT-Department, etc.) |\n| **Assignment** | How users got this policy: \"Default (inherited)\" for Global, \"Direct \u002F Group\" for custom, \"Group\" for group-assigned |\n| **User Count** | Number of users on this policy tier |\n| **Percentage** | What percentage of total users this represents |\n| **Group ID** | If assigned via group, the Azure AD group ID |\n\n### Color Legend\n\n| Color | Where | Meaning |\n|---|---|---|\n| **Red background + dark red text** on Current Global | All Decisions, Category sheets | Your current value differs from the recommendation -- needs review |\n| **Green background + green text** on Current Global | All Decisions | Your current value matches the recommendation -- already aligned |\n| **Red background + dark red text** on Risk column | All Decisions, Category sheets | \"High\" risk setting |\n| **Yellow background + dark text** on Risk column | All Decisions, Category sheets | \"Medium\" risk setting |\n| **Yellow background** on DECISION column | All Decisions, Category sheets | This cell is waiting for your input |\n| **Green bold text** on DECISION column | All Decisions | Decision entered that changes the current value |\n| **Orange background** on DECISION header | All Decisions | Draws attention to the decision column |\n| **Blue background** on tier column headers | Category sheets | Custom policy tier columns |\n| **Light yellow + red text** in tier columns | Category sheets | Tier value differs from Global (i.e., this tier overrides the default) |\n| **Light blue background** on Assignment column | User Impact | \"Default (inherited)\" -- users on the Global policy |\n| **Light green background** on Assignment column | User Impact | \"Group\" assigned policy |\n| **Bold dark red** on High Risk count | Overview | Categories with high-risk settings that need attention |\n\n---\n\n## Troubleshooting\n\n### \"MicrosoftTeams module not found\"\n\nYou need to install the module first:\n\n```powershell\nInstall-Module MicrosoftTeams -Scope CurrentUser -Force -AllowClobber\n```\n\nIf you get a permissions error, make sure you are using `-Scope CurrentUser` (does not require admin rights on the machine).\n\n### \"ImportExcel module not found\"\n\n```powershell\nInstall-Module ImportExcel -Scope CurrentUser -Force\n```\n\nIf you do not need the Excel report, you can skip it:\n\n```powershell\n.\\Export-TeamsPolicies.ps1 -SkipExcel\n```\n\n### Authentication Fails \u002F Browser Does Not Open\n\n**On a remote or headless server:** Use device code authentication:\n\n```powershell\n.\\Export-TeamsPolicies.ps1 -AuthMethod DeviceCode\n```\n\n**Browser opens but sign-in fails:** Make sure you are signing in with an account that has Teams Administrator or Global Administrator rights.\n\n**Token expired mid-run:** The MicrosoftTeams module session can expire during long exports. If you see authentication errors partway through, try running with `-IncludeAssignments` disabled first (it is faster), then do a second run for assignments only.\n\n### \"No manifest.csv found in ...\" (ExcelOnly mode)\n\nYou pointed `-OutDir` to a folder that does not contain a previous export. Make sure the path is correct and contains `manifest.csv`, `raw-json\u002F`, and `flat-csv\u002F`.\n\n```powershell\n# Check that the folder has the right contents\nGet-ChildItem .\\Teams-Policy-Export-20260309-143000\\\n```\n\n### Some Cmdlets Show \"Failed\" in the Manifest\n\nThis is normal. Some cmdlets fail because:\n\n- The feature is not licensed in your tenant (e.g., education policies in a non-education tenant)\n- The cmdlet requires specific licensing (audio conferencing, calling plans)\n- The cmdlet was deprecated in your version of the MicrosoftTeams module\n\nThe script continues past failures and reports them in `manifest.csv`. Check the `Error` column for details.\n\n### The Script Takes a Long Time\n\n**Without `-IncludeAssignments`:** A typical run exports 70-80 cmdlets and takes 2-5 minutes.\n\n**With `-IncludeAssignments`:** Retrieving user data is the slow part. For a 2,000-user tenant, expect 5-10 minutes. For larger tenants (50,000+), it can take 30+ minutes. You can reduce `-UserResultSize` to export fewer users:\n\n```powershell\n# Only retrieve the first 10,000 users\n.\\Export-TeamsPolicies.ps1 -IncludeAssignments -UserResultSize 10000\n```\n\n### Excel File Is Too Large or Takes Long to Open\n\nIf your tenant has many custom policy tiers, the category sheets can get wide. Try opening the file in Excel desktop rather than Excel Online. If you only need the raw data, use the CSV files in `flat-csv\u002F`.\n\n---\n\n## Architecture Overview\n\nThe tool is organized into a main script and six modules, each handling a specific part of the pipeline:\n\n```\nExport-TeamsPolicies.ps1          Main script -- orchestrates everything\n        |\n        |--- Config\u002F                    Configuration files (baselines, categories, names)\n        |       |-- ImportantPolicies.psd1     Recommended values per setting\n        |       |-- PolicyCategories.psd1      Groups cmdlets into categories\n        |       |-- FriendlyNames.psd1         Human-readable setting labels\n        |       |-- PropertyExclusions.psd1    Noise fields to hide\n        |       +-- PolicyDefaults.psd1        (Optional) offline defaults baseline\n        |\n        +--- Modules\u002F\n                |\n                |-- Utilities     Shared helpers: logging, object flattening,\n                |                 manifest entries, sheet name generation\n                |\n                |-- Discovery     Finds all Get-CsTeams* cmdlets in the\n                |                 MicrosoftTeams module and invokes them safely\n                |\n                |-- Export        Saves data to JSON + CSV, filters Global rows,\n                |                 writes the manifest file\n                |\n                |-- Assignments   Retrieves per-user and group policy assignments\n                |                 using batched processing for large tenants\n                |\n                |-- Analysis      Computes user impact, risk levels, drift detection,\n                |                 friendly names, value distributions, decision rows\n                |\n                +-- Excel         Builds the multi-sheet Excel workbook with\n                                  formatting, conditional coloring, and dropdowns\n```\n\n### Data Flow\n\n```\nMicrosoft Teams APIs\n        |\n        v\n  [Discovery]  Discover cmdlets --> list of Get-Cs* commands\n        |\n        v\n  [Discovery]  Invoke each cmdlet safely --> raw policy objects\n        |\n        v\n  [Export]     Save to JSON + CSV, extract Global rows\n        |\n        v\n  [Assignments]  (optional) Retrieve user + group assignments\n        |\n        v\n  [Analysis]   Compute user counts, risk levels, drift,\n               build decision rows with friendly names\n        |\n        v\n  [Excel]      Generate workbook: Overview, All Decisions,\n               Category sheets, User Impact\n        |\n        v\n  TeamsPolicies.xlsx  \u003C-- ready for the meeting\n```\n\n---\n\n## Further Reading\n\n- **[docs\u002FCONFIGURATION.md](docs\u002FCONFIGURATION.md)** -- How to customize the config files (add your own baselines, friendly names, categories)\n- **[docs\u002FARCHITECTURE.md](docs\u002FARCHITECTURE.md)** -- Technical deep-dive into how each module works\n- **[docs\u002FRUNBOOK.md](docs\u002FRUNBOOK.md)** -- Step-by-step operational guide for running exports and using the output in meetings\n\n---\n\n## Running Tests\n\nThe project includes Pester tests for the core modules. To run them:\n\n```powershell\n# Install Pester if you don't have it\nInstall-Module Pester -Scope CurrentUser -Force -SkipPublisherCheck\n\n# Run all tests\nInvoke-Pester -Path .\\Tests\\ -Output Detailed\n```\n\n---\n\n## License\n\nApache 2.0. See [LICENSE](LICENSE) for the full text.\n","Teams Policy Export Tool 是一个PowerShell工具，用于导出Microsoft Teams的策略和配置，并生成结构化的文件（JSON、CSV）以及为决策会议设计的格式化Excel工作簿。其核心功能包括连接到用户的Microsoft 365租户，读取所有Teams策略设置，并生成显示当前配置、推荐设置、差异分析及影响用户数量的电子表格，同时提供记录会议决策的列。该工具适用于需要定期审查或调整Teams策略的企业环境，特别是当涉及到多利益相关者参与决策时。使用此工具前需确保安装了特定版本的PowerShell、MicrosoftTeams模块以及ImportExcel模块，并拥有Teams管理员或全局管理员权限。",2,"2026-06-11 03:55:15","CREATED_QUERY"]