ms365-tenant-manager
Microsoft 365 tenant administration for Global Administrators. Automate M365 tenant setup, Office 365 admin tasks, Azure AD user management, Exchange Online configuration, Teams administration, and security policies. Generate PowerShell scripts for bulk operations, Conditional Access policies, license management, and compliance reporting. Use for M365 tenant manager, Office 365 admin, Azure AD users, Global Administrator, tenant configuration, or Microsoft 365 automation.
What this skill does
# Microsoft 365 Tenant Manager The agent generates production-ready PowerShell scripts for M365 tenant setup, bulk user provisioning, Conditional Access policies, security audits, and license management. It automates user lifecycle operations (onboarding, offboarding), recommends license SKUs by role, and produces 7-category security audit reports via Microsoft Graph. --- ## Quick Start ### Generate Security Audit Script ```bash python scripts/powershell_generator.py --action audit --output audit_script.ps1 ``` ### Create Bulk User Provisioning Script ```bash python scripts/user_management.py --action provision --csv users.csv --license E3 ``` ### Configure Conditional Access Policy ```bash python scripts/powershell_generator.py --action conditional-access --require-mfa --include-admins ``` --- ## Tools ### powershell_generator.py Generates ready-to-use PowerShell scripts for Microsoft 365 administration. **Usage:** ```bash # Generate security audit script python scripts/powershell_generator.py --action audit # Generate Conditional Access policy script python scripts/powershell_generator.py --action conditional-access \ --policy-name "Require MFA for Admins" \ --require-mfa \ --include-users "All" # Generate bulk license assignment script python scripts/powershell_generator.py --action license \ --csv users.csv \ --sku "ENTERPRISEPACK" ``` **Parameters:** | Parameter | Required | Description | |-----------|----------|-------------| | `--action` | Yes | Script type: `audit`, `conditional-access`, `license`, `users` | | `--policy-name` | No | Name for Conditional Access policy | | `--require-mfa` | No | Require MFA in policy | | `--include-users` | No | Users to include: `All` or specific UPNs | | `--csv` | No | CSV file path for bulk operations | | `--sku` | No | License SKU for assignment | | `--output` | No | Output file path (default: stdout) | **Output:** Complete PowerShell scripts with error handling, logging, and best practices. ### user_management.py Automates user lifecycle operations and bulk provisioning. **Usage:** ```bash # Provision users from CSV python scripts/user_management.py --action provision --csv new_users.csv # Offboard user securely python scripts/user_management.py --action offboard --user [email protected] # Generate inactive users report python scripts/user_management.py --action report-inactive --days 90 ``` **Parameters:** | Parameter | Required | Description | |-----------|----------|-------------| | `--action` | Yes | Operation: `provision`, `offboard`, `report-inactive`, `sync` | | `--csv` | No | CSV file for bulk operations | | `--user` | No | Single user UPN | | `--days` | No | Days for inactivity threshold (default: 90) | | `--license` | No | License SKU to assign | ### tenant_setup.py Initial tenant configuration and service provisioning automation. **Usage:** ```bash # Generate tenant setup checklist python scripts/tenant_setup.py --action checklist --company "Acme Inc" --users 50 # Generate DNS records configuration python scripts/tenant_setup.py --action dns --domain acme.com # Generate security baseline script python scripts/tenant_setup.py --action security-baseline ``` --- ## Workflows ### Workflow 1: New Tenant Setup **Step 1: Generate Setup Checklist** ```bash python scripts/tenant_setup.py --action checklist --company "Company Name" --users 100 ``` **Step 2: Configure DNS Records** ```bash python scripts/tenant_setup.py --action dns --domain company.com ``` **Step 3: Apply Security Baseline** ```bash python scripts/powershell_generator.py --action audit > initial_audit.ps1 ``` **Step 4: Provision Users** ```bash python scripts/user_management.py --action provision --csv employees.csv --license E3 ``` ### Workflow 2: Security Hardening **Step 1: Run Security Audit** ```bash python scripts/powershell_generator.py --action audit --output security_audit.ps1 ``` **Step 2: Create MFA Policy** ```bash python scripts/powershell_generator.py --action conditional-access \ --policy-name "Require MFA All Users" \ --require-mfa \ --include-users "All" ``` **Step 3: Review Results** Execute generated scripts and review CSV reports in output directory. ### Workflow 3: User Offboarding **Step 1: Generate Offboarding Script** ```bash python scripts/user_management.py --action offboard --user [email protected] ``` **Step 2: Execute Script with -WhatIf** ```powershell .\offboard_user.ps1 -WhatIf ``` **Step 3: Execute for Real** ```powershell .\offboard_user.ps1 -Confirm:$false ``` --- ## Best Practices ### Tenant Setup 1. Enable MFA before adding users 2. Configure named locations for Conditional Access 3. Use separate admin accounts with PIM 4. Verify custom domains before bulk user creation 5. Apply Microsoft Secure Score recommendations ### Security Operations 1. Start Conditional Access policies in report-only mode 2. Use `-WhatIf` parameter before executing scripts 3. Never hardcode credentials in scripts 4. Enable audit logging for all operations 5. Regular quarterly security reviews ### PowerShell Automation 1. Prefer Microsoft Graph over legacy MSOnline modules 2. Include try/catch blocks for error handling 3. Implement logging for audit trails 4. Use Azure Key Vault for credential management 5. Test in non-production tenant first --- ## Reference Guides ### When to Use Each Reference **references/powershell-templates.md** - Ready-to-use script templates - Conditional Access policy examples - Bulk user provisioning scripts - Security audit scripts **references/security-policies.md** - Conditional Access configuration - MFA enforcement strategies - DLP and retention policies - Security baseline settings **references/troubleshooting.md** - Common error resolutions - PowerShell module issues - Permission troubleshooting - DNS propagation problems --- ## Limitations | Constraint | Impact | |------------|--------| | Global Admin required | Full tenant setup needs highest privilege | | API rate limits | Bulk operations may be throttled | | License dependencies | E3/E5 required for advanced features | | Hybrid scenarios | On-premises AD needs additional configuration | | PowerShell prerequisites | Microsoft.Graph module required | ### Required PowerShell Modules ```powershell Install-Module Microsoft.Graph -Scope CurrentUser Install-Module ExchangeOnlineManagement -Scope CurrentUser Install-Module MicrosoftTeams -Scope CurrentUser ``` ### Required Permissions - **Global Administrator** - Full tenant setup - **User Administrator** - User management - **Security Administrator** - Security policies - **Exchange Administrator** - Mailbox management --- ## Anti-Patterns - **Using admin accounts for daily work** -- Global Admin accounts should use PIM (Privileged Identity Management) with JIT activation; use separate accounts for daily tasks - **Skipping report-only mode** -- deploying Conditional Access policies directly to enforcement blocks legitimate users; always validate in report-only mode first - **Hardcoding credentials in scripts** -- PowerShell scripts with embedded passwords are security incidents waiting to happen; use Azure Key Vault or environment variables - **Using legacy MSOnline module** -- MSOnline is deprecated; all new scripts should use Microsoft Graph (`Connect-MgGraph`) - **No break-glass account** -- excluding zero accounts from CA policies means a misconfiguration can lock out all admins; maintain at least one excluded emergency access account - **Bulk operations without -WhatIf** -- running bulk user creation or license assignment without dry-run risks mass misconfiguration; always test with `-WhatIf` first --- ## Troubleshooting | Problem | Cause | Solution | |---------|-------|----------| | `Connect-MgGraph` fails with "Insufficient privileges" | App registration missing required API permissions | Grant `Directory.ReadWrite.All`, `User.ReadWrite.All`, and `Policy.ReadWrite.Conditiona
Related in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".