Skip to content
Back to skills

Ms365 Tenant Manager

ASecurity

Automate Microsoft 365 tenant setup, Azure AD user management, Exchange Online configuration, security policies, and compliance reporting with PowerShell scripts for Global Administrators.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 14, 2026
securitygoshellbashrailsazureapibackendsecurity

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned November 14, 2026

npx -y skills add SebastianLuser/claude-code-arcane --skill ms365-tenant-manager --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ms365 Tenant Manager?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ms365 Tenant Manager
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sebastianluser-ms365-tenant-manager/badge)](https://www.skillsdirectory.com/skills/sebastianluser-ms365-tenant-manager)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ms365-tenant-manager
description: "Automate Microsoft 365 tenant setup, Azure AD user management, Exchange Online configuration, security policies, and compliance reporting with PowerShell scripts for Global Administrators."
argument-hint: ""
category: "backend"
user-invocable: true
allowed-tools: Read, Glob, Grep, Bash, Write, Edit
---

# Microsoft 365 Tenant Manager

Expert guidance and automation for Microsoft 365 Global Administrators managing tenant setup, user lifecycle, security policies, and organizational optimization.

> **Note:** This skill may create or modify files in your project. It will ask before writing.

## Quick Start

### Run a Security Audit

```powershell
Connect-MgGraph -Scopes "Directory.Read.All","Policy.Read.All","AuditLog.Read.All"
Get-MgSubscribedSku | Select-Object SkuPartNumber, ConsumedUnits, @{N="Total";E={$_.PrepaidUnits.Enabled}}
Get-MgPolicyAuthorizationPolicy | Select-Object AllowInvitesFrom, DefaultUserRolePermissions
```

### Bulk Provision Users from CSV

```powershell
# CSV columns: DisplayName, UserPrincipalName, Department, LicenseSku
Import-Csv .\new_users.csv | ForEach-Object {
    $passwordProfile = @{ Password = (New-Guid).ToString().Substring(0,16) + "!"; ForceChangePasswordNextSignIn = $true }
    New-MgUser -DisplayName $_.DisplayName -UserPrincipalName $_.UserPrincipalName `
               -Department $_.Department -AccountEnabled -PasswordProfile $passwordProfile
}
```

### Create a Conditional Access Policy (MFA for Admins)

```powershell
$adminRoles = (Get-MgDirectoryRole | Where-Object { $_.DisplayName -match "Admin" }).Id
$policy = @{
    DisplayName = "Require MFA for Admins"
    State = "enabledForReportingButNotEnforced"   # Start in report-only mode
    Conditions = @{ Users = @{ IncludeRoles = $adminRoles } }
    GrantControls = @{ Operator = "OR"; BuiltInControls = @("mfa") }
}
New-MgIdentityConditionalAccessPolicy -BodyParameter $policy
```

## 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 (and DNS propagation) before bulk user creation
5. Apply Microsoft Secure Score recommendations

### Security Operations

1. Start Conditional Access policies in report-only mode
2. Review Sign-in logs for 48 h before enforcing a new policy
3. Never hardcode credentials in scripts -- use Azure Key Vault or `Get-Credential`
4. Enable unified audit logging for all operations
5. Conduct quarterly security reviews and Secure Score check-ins

### PowerShell Automation

1. Prefer Microsoft Graph (`Microsoft.Graph` module) over legacy MSOnline
2. Include `try/catch` blocks for error handling
3. Implement `Write-Host`/`Write-Warning` logging for audit trails
4. Use `-WhatIf` or dry-run output before bulk destructive operations
5. Test in a non-production tenant first

## Detailed Workflows

> See references/workflow-scripts.md for complete PowerShell scripts covering new tenant setup, security hardening, and user offboarding workflows.

## Reference Guides

| Reference | Contents |
|-----------|----------|
| references/powershell-templates.md | Ready-to-use script templates, Conditional Access examples, bulk provisioning |
| references/security-policies.md | Conditional Access config, MFA strategies, DLP and retention policies |
| references/troubleshooting.md | Common error resolutions, PowerShell module issues, permission troubleshooting |

## 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
```

Files in this skill

  • SKILL.md4 KB
  • references/powershell-templates.md21 KB
  • references/security-policies.md8.6 KB
  • references/troubleshooting.md9.6 KB
  • references/workflow-scripts.md4.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.