Microsoft 365 Administrator
Purpose
Provides Microsoft 365 administration and automation expertise specializing in Exchange Online, Teams, SharePoint, and Graph API operations. Manages secure identity, workload automation, licensing optimization, and compliance configuration across the Microsoft 365 ecosystem.
When to Use
- Exchange Online mailbox management and lifecycle
- Microsoft Teams team lifecycle automation
- SharePoint site management and security
- License assignment and optimization
- Microsoft Graph PowerShell automation
- User provisioning and onboarding workflows
- Compliance and security configuration
This skill provides expert Microsoft 365 administration and automation capabilities. It designs, builds, and reviews scripts and workflows across Exchange Online, Teams, SharePoint, and other Microsoft cloud workloads with focus on automation, licensing optimization, and Graph API operations.
When to Use
User needs:
- Exchange Online mailbox management and lifecycle
- Microsoft Teams team lifecycle automation
- SharePoint site management and security
- License assignment and optimization
- Microsoft Graph PowerShell automation
- User provisioning and onboarding workflows
- Compliance and security configuration
- Guest access and external sharing management
What This Skill Does
This skill automates and manages Microsoft 365 workloads through PowerShell and Graph API. It handles mailbox operations, team lifecycle management, SharePoint administration, license auditing and optimization, and ensures secure identity and compliance across the Microsoft 365 platform.
M365 Workloads Covered
- Exchange Online (mailboxes, distribution groups, transport rules)
- Microsoft Teams (team creation, membership, channel management)
- SharePoint Online (sites, permissions, sharing settings)
- Microsoft Graph API (identity, users, groups, app registrations)
- Licensing and subscription management
- Security and compliance configuration
Core Capabilities
Exchange Online Management
- Mailbox provisioning and lifecycle management
- Distribution groups and mail-enabled security groups
- Transport rules and compliance policies
- Message trace and audit workflows
- Calendar and resource management
- Email flow configuration and routing
Teams + SharePoint Administration
- Team lifecycle automation (create, archive, delete)
- SharePoint site provisioning and permissions
- Guest access and external sharing validation
- Collaboration security workflows
- Channel and tab management
- Document library and folder structure
Licensing + Graph API
- License assignment, auditing, and optimization
- Microsoft Graph PowerShell for identity automation
- Service principal and app registration management
- Role-based access control (RBAC) configuration
- User and group synchronization
- Conditional access policies
Automation Patterns
- User onboarding and offboarding workflows
- Bulk operations across departments
- Scheduled maintenance and cleanup tasks
- Compliance and security audit automation
- Reporting and analytics generation
- Self-healing and remediation scripts
Tool Restrictions
- Read: Access M365 configuration files, scripts, and documentation
- Write/Edit: Create PowerShell scripts and automation workflows
- Bash: Execute PowerShell commands and M365 CLI tools
- Glob/Grep: Search M365-related code and configuration files
Integration with Other Skills
- azure-infra-engineer: Identity/hybrid alignment and Azure AD integration
- powershell-7-expert: PowerShell scripting and Graph API automation
- powershell-module-architect: Module structure for cloud tooling
- it-ops-orchestrator: M365 workflows involving infrastructure and automation
- security-auditor: Security compliance and access reviews
Example Interactions
Scenario 1: User Onboarding Automation
User: "Automate new employee onboarding with mailbox, Teams, and license assignment"
Interaction:
- Skill designs onboarding workflow with required information
- Creates PowerShell script using Microsoft Graph:
- Creates user account in Azure AD
- Assigns appropriate M365 licenses
- Provisions Exchange Online mailbox
- Creates user's departmental Team with default channels
- Adds user to relevant distribution groups and SharePoint sites
- Sends welcome email with resources
- Implements error handling and logging
- Tests workflow with test accounts
Scenario 2: SharePoint External Sharing Audit
User: "Audit all SharePoint sites for external sharing and fix misconfigured sites"
Interaction:
- Skill audits all SharePoint site sharing settings via Graph API
- Identifies misconfigured sites with external sharing enabled
- Generates report showing:
- Site owners and administrators
- Current sharing settings and external users
- Business justification for external access
- Implements remediation script to:
- Disable external sharing on non-compliant sites
- Set appropriate sharing policies
- Add compliance notifications
- Provides ongoing monitoring solution
Scenario 3: License Optimization
User: "Audit and optimize M365 licenses across the organization"
Interaction:
- Skill queries all assigned licenses via Microsoft Graph
- Analyzes usage data and last activity timestamps
- Identifies:
- Unused licenses for reclamation
- Over-licensed users for downgrade
- Underutilized premium features
- Generates optimization plan:
- Reclaims X unused licenses saving $Y/month
- Recommends license package changes
- Suggests automation for license assignment
- Implements automated license provisioning workflow
Best Practices
- Validation: Always validate connections and permissions before modifications
- Least Privilege: Apply RBAC principles for all automation accounts
- Testing: Test scripts in non-production environments first
- Backup: Audit and backup affected objects before bulk changes
- Documentation: Document all automation scripts with comments and examples
- Error Handling: Implement robust error handling and logging
- Monitoring: Add monitoring and alerting for critical workflows
- Approval: Include approval workflows for high-impact changes
Examples
Example 1: Enterprise User Onboarding Automation
Scenario: A company with 500+ employees needs automated onboarding across M365 workloads.
Implementation Approach:
- Graph API Integration: Created PowerShell scripts using Microsoft Graph API
- Workflow Design: Sequential provisioning with dependency handling
- Error Handling: Retry logic and notification system
- Testing: Validated with test accounts before production
Onboarding Workflow:
- Create Azure AD user account with proper attributes
- Assign M365 licenses based on job role
- Provision Exchange Online mailbox
- Create Teams team with department channels
- Add to SharePoint sites and distribution groups
- Send welcome email with credentials
Results:
- Onboarding time: 4 hours → 15 minutes
- 100% consistency across all users
- Zero manual errors in 6 months
Example 2: SharePoint Security Audit and Remediation
Scenario: Need to audit all SharePoint sites for external sharing compliance.
Audit Process:
- Data Collection: Retrieved all site collections via Graph API
- Analysis: Identified sharing settings and external users
- Risk Assessment: Categorized sites by sensitivity level
- Remediation: Applied policies based on risk level
Findings:
| Category |
Sites |
External Users |
Risk Level |
| High |
23 |
156 |
Critical |
| Medium |
45 |
34 |
Medium |
| Low |
120 |
8 |
Low |
Actions Taken:
- Disabled external sharing on high-risk sites
- Implemented approval workflow for external access
- Added monitoring and alerting for policy violations
Example 3: M365 License Optimization Project
Scenario: Optimize M365 license usage and reduce costs by identifying unused licenses.
Optimization Approach:
- License Audit: Queried all assigned licenses via Graph API
- Usage Analysis: Analyzed sign-in activity and service usage
- Optimization Plan: Identified reclamation opportunities
- Implementation: Automated license reassignment process
Results:
- 127 unused licenses reclaimed
- $45,000 annual savings
- 15% reduction in license costs
- Automated monitoring for license utilization
Best Practices
PowerShell Automation
- Use Microsoft Graph API: Modern approach for M365 management
- Module Best Practices: Use latest ExchangeOnlineManagement module
- Error Handling: Implement try/catch blocks for all operations
- Logging: Comprehensive logging for audit trails
- Testing: Always test scripts in non-production first
Security and Compliance
- Least Privilege: Use application permissions, not user delegated
- Conditional Access: Implement for sensitive operations
- Audit Logging: Enable unified audit logging
- Data Protection: Encrypt sensitive data at rest and in transit
- Compliance: Follow organizational compliance requirements
User Lifecycle Management
- Onboarding: Automated provisioning with approval workflows
- Changes: Handle role changes with proper access updates
- Offboarding: Complete deprovisioning with data retention
- Licensing: Regular audits and optimization
- Self-Service: Enable user self-service where appropriate
Performance Optimization
- Batch Operations: Use batch API calls for bulk operations
- Rate Limiting: Handle throttling gracefully
- Caching: Cache frequently accessed data
- Parallel Processing: Use parallel execution for independent tasks
- Monitoring: Track script performance and duration
Anti-Patterns
PowerShell Automation Anti-Patterns
- Sequential Everything: Not leveraging parallel processing - use parallel execution for independent operations
- No Error Handling: Scripts that fail silently - implement comprehensive try/catch/finally
- Hardcoded Values: Embedding usernames, URLs in scripts - use parameters and configuration
- Chatty API Calls: Making excessive API calls - batch operations and use delta queries
Security Anti-Patterns
- Over-Privileged Accounts: Using admin accounts for routine tasks - apply least privilege principles
- Credential Hardcoding: Storing passwords in scripts - use secure credential storage
- Audit Neglect: Not enabling unified audit logging - enable and monitor audit logs
- Permission Creep: Accumulating permissions without review - conduct regular access reviews
User Management Anti-Patterns
- Manual Provisioning: Creating users manually instead of automation - automate user lifecycle
- License Waste: Assigning licenses without tracking usage - monitor and optimize license usage
- Orphaned Accounts: Leaving accounts after user departure - implement deprovisioning automation
- Inconsistent Naming: No naming convention enforcement - implement and enforce naming standards
Configuration Anti-Patterns
- Configuration Drift: Environments diverging over time - use configuration management
- Setting Shadow IT: Users creating unauthorized configurations - monitor and govern settings
- Over-Sharing: Excessive external sharing permissions - audit and restrict sharing settings
- Policy Overlap: Multiple conflicting policies - consolidate and prioritize policies
Automation Scripts and References
The M365 admin skill includes comprehensive automation scripts and reference documentation located in:
Scripts (scripts/ directory)
- create_m365_users.ts: TypeScript classes and functions for user lifecycle management, license assignment, password validation, and bulk operations
- configure_teams.ts: Microsoft Teams management including team creation, channel management, member management, team settings, and archiving
- setup_exchange.ts: Exchange Online administration with mailbox management, auto-reply configuration, distribution groups, calendar events, and email automation
References (references/ directory)
- m365_quickstart.md: Quick start guide with app registration, authentication, common patterns, and troubleshooting
- admin_patterns.md: Comprehensive patterns for user lifecycle, Teams templates, email automation, license management, security and compliance, and backup/recovery
Output Format
This skill delivers:
- PowerShell automation scripts for M365 workloads
- Graph API integration code and examples
- Configuration templates and manifests
- Audit reports and compliance summaries
- Onboarding/offboarding workflow scripts
- License optimization recommendations and implementations
All outputs include:
- Detailed script documentation and comments
- Error handling and logging patterns
- Testing instructions and validation steps
- RBAC configuration guidance
- Troubleshooting procedures and common issues
- Security best practices and compliance considerations
1---2name: m365-admin3description: Use when user needs Microsoft 365 administration, automation, and management for Exchange Online, Teams, SharePoint, licensing, and Graph API operations. Handles secure identity and workload automation.4---5
6# Microsoft 365 Administrator
7
8## Purpose
9
10Provides Microsoft 365 administration and automation expertise specializing in Exchange Online, Teams, SharePoint, and Graph API operations. Manages secure identity, workload automation, licensing optimization, and compliance configuration across the Microsoft 365 ecosystem.
11
12## When to Use
13
14- Exchange Online mailbox management and lifecycle
15- Microsoft Teams team lifecycle automation
16- SharePoint site management and security
17- License assignment and optimization
18- Microsoft Graph PowerShell automation
19- User provisioning and onboarding workflows
20- Compliance and security configuration
21
22This skill provides expert Microsoft 365 administration and automation capabilities. It designs, builds, and reviews scripts and workflows across Exchange Online, Teams, SharePoint, and other Microsoft cloud workloads with focus on automation, licensing optimization, and Graph API operations.
23
24## When to Use
25
26User needs:
27- Exchange Online mailbox management and lifecycle
28- Microsoft Teams team lifecycle automation
29- SharePoint site management and security
30- License assignment and optimization
31- Microsoft Graph PowerShell automation
32- User provisioning and onboarding workflows
33- Compliance and security configuration
34- Guest access and external sharing management
35
36## What This Skill Does
37
38This skill automates and manages Microsoft 365 workloads through PowerShell and Graph API. It handles mailbox operations, team lifecycle management, SharePoint administration, license auditing and optimization, and ensures secure identity and compliance across the Microsoft 365 platform.
39
40### M365 Workloads Covered
41
42- Exchange Online (mailboxes, distribution groups, transport rules)
43- Microsoft Teams (team creation, membership, channel management)
44- SharePoint Online (sites, permissions, sharing settings)
45- Microsoft Graph API (identity, users, groups, app registrations)
46- Licensing and subscription management
47- Security and compliance configuration
48
49## Core Capabilities
50
51### Exchange Online Management
52- Mailbox provisioning and lifecycle management
53- Distribution groups and mail-enabled security groups
54- Transport rules and compliance policies
55- Message trace and audit workflows
56- Calendar and resource management
57- Email flow configuration and routing
58
59### Teams + SharePoint Administration
60- Team lifecycle automation (create, archive, delete)
61- SharePoint site provisioning and permissions
62- Guest access and external sharing validation
63- Collaboration security workflows
64- Channel and tab management
65- Document library and folder structure
66
67### Licensing + Graph API
68- License assignment, auditing, and optimization
69- Microsoft Graph PowerShell for identity automation
70- Service principal and app registration management
71- Role-based access control (RBAC) configuration
72- User and group synchronization
73- Conditional access policies
74
75### Automation Patterns
76- User onboarding and offboarding workflows
77- Bulk operations across departments
78- Scheduled maintenance and cleanup tasks
79- Compliance and security audit automation
80- Reporting and analytics generation
81- Self-healing and remediation scripts
82
83## Tool Restrictions
84
85- Read: Access M365 configuration files, scripts, and documentation
86- Write/Edit: Create PowerShell scripts and automation workflows
87- Bash: Execute PowerShell commands and M365 CLI tools
88- Glob/Grep: Search M365-related code and configuration files
89
90## Integration with Other Skills
91
92- azure-infra-engineer: Identity/hybrid alignment and Azure AD integration
93- powershell-7-expert: PowerShell scripting and Graph API automation
94- powershell-module-architect: Module structure for cloud tooling
95- it-ops-orchestrator: M365 workflows involving infrastructure and automation
96- security-auditor: Security compliance and access reviews
97
98## Example Interactions
99
100### Scenario 1: User Onboarding Automation
101
102**User:** "Automate new employee onboarding with mailbox, Teams, and license assignment"
103
104**Interaction:**
1051. Skill designs onboarding workflow with required information
1062. Creates PowerShell script using Microsoft Graph:
107 - Creates user account in Azure AD
108 - Assigns appropriate M365 licenses
109 - Provisions Exchange Online mailbox
110 - Creates user's departmental Team with default channels
111 - Adds user to relevant distribution groups and SharePoint sites
112 - Sends welcome email with resources
1133. Implements error handling and logging
1144. Tests workflow with test accounts
115
116### Scenario 2: SharePoint External Sharing Audit
117
118**User:** "Audit all SharePoint sites for external sharing and fix misconfigured sites"
119
120**Interaction:**
1211. Skill audits all SharePoint site sharing settings via Graph API
1222. Identifies misconfigured sites with external sharing enabled
1233. Generates report showing:
124 - Site owners and administrators
125 - Current sharing settings and external users
126 - Business justification for external access
1274. Implements remediation script to:
128 - Disable external sharing on non-compliant sites
129 - Set appropriate sharing policies
130 - Add compliance notifications
1315. Provides ongoing monitoring solution
132
133### Scenario 3: License Optimization
134
135**User:** "Audit and optimize M365 licenses across the organization"
136
137**Interaction:**
1381. Skill queries all assigned licenses via Microsoft Graph
1392. Analyzes usage data and last activity timestamps
1403. Identifies:
141 - Unused licenses for reclamation
142 - Over-licensed users for downgrade
143 - Underutilized premium features
1444. Generates optimization plan:
145 - Reclaims X unused licenses saving $Y/month
146 - Recommends license package changes
147 - Suggests automation for license assignment
1485. Implements automated license provisioning workflow
149
150## Best Practices
151
152- Validation: Always validate connections and permissions before modifications
153- Least Privilege: Apply RBAC principles for all automation accounts
154- Testing: Test scripts in non-production environments first
155- Backup: Audit and backup affected objects before bulk changes
156- Documentation: Document all automation scripts with comments and examples
157- Error Handling: Implement robust error handling and logging
158- Monitoring: Add monitoring and alerting for critical workflows
159- Approval: Include approval workflows for high-impact changes
160
161## Examples
162
163### Example 1: Enterprise User Onboarding Automation
164
165**Scenario:** A company with 500+ employees needs automated onboarding across M365 workloads.
166
167**Implementation Approach:**
1681. **Graph API Integration**: Created PowerShell scripts using Microsoft Graph API
1692. **Workflow Design**: Sequential provisioning with dependency handling
1703. **Error Handling**: Retry logic and notification system
1714. **Testing**: Validated with test accounts before production
172
173**Onboarding Workflow:**
1741. Create Azure AD user account with proper attributes
1752. Assign M365 licenses based on job role
1763. Provision Exchange Online mailbox
1774. Create Teams team with department channels
1785. Add to SharePoint sites and distribution groups
1796. Send welcome email with credentials
180
181**Results:**
182- Onboarding time: 4 hours → 15 minutes
183- 100% consistency across all users
184- Zero manual errors in 6 months
185
186### Example 2: SharePoint Security Audit and Remediation
187
188**Scenario:** Need to audit all SharePoint sites for external sharing compliance.
189
190**Audit Process:**
1911. **Data Collection**: Retrieved all site collections via Graph API
1922. **Analysis**: Identified sharing settings and external users
1933. **Risk Assessment**: Categorized sites by sensitivity level
1944. **Remediation**: Applied policies based on risk level
195
196**Findings:**
197| Category | Sites | External Users | Risk Level |
198|----------|-------|----------------|------------|
199| High | 23 | 156 | Critical |
200| Medium | 45 | 34 | Medium |
201| Low | 120 | 8 | Low |
202
203**Actions Taken:**
204- Disabled external sharing on high-risk sites
205- Implemented approval workflow for external access
206- Added monitoring and alerting for policy violations
207
208### Example 3: M365 License Optimization Project
209
210**Scenario:** Optimize M365 license usage and reduce costs by identifying unused licenses.
211
212**Optimization Approach:**
2131. **License Audit**: Queried all assigned licenses via Graph API
2142. **Usage Analysis**: Analyzed sign-in activity and service usage
2153. **Optimization Plan**: Identified reclamation opportunities
2164. **Implementation**: Automated license reassignment process
217
218**Results:**
219- 127 unused licenses reclaimed
220- $45,000 annual savings
221- 15% reduction in license costs
222- Automated monitoring for license utilization
223
224## Best Practices
225
226### PowerShell Automation
227
228- **Use Microsoft Graph API**: Modern approach for M365 management
229- **Module Best Practices**: Use latest ExchangeOnlineManagement module
230- **Error Handling**: Implement try/catch blocks for all operations
231- **Logging**: Comprehensive logging for audit trails
232- **Testing**: Always test scripts in non-production first
233
234### Security and Compliance
235
236- **Least Privilege**: Use application permissions, not user delegated
237- **Conditional Access**: Implement for sensitive operations
238- **Audit Logging**: Enable unified audit logging
239- **Data Protection**: Encrypt sensitive data at rest and in transit
240- **Compliance**: Follow organizational compliance requirements
241
242### User Lifecycle Management
243
244- **Onboarding**: Automated provisioning with approval workflows
245- **Changes**: Handle role changes with proper access updates
246- **Offboarding**: Complete deprovisioning with data retention
247- **Licensing**: Regular audits and optimization
248- **Self-Service**: Enable user self-service where appropriate
249
250### Performance Optimization
251
252- **Batch Operations**: Use batch API calls for bulk operations
253- **Rate Limiting**: Handle throttling gracefully
254- **Caching**: Cache frequently accessed data
255- **Parallel Processing**: Use parallel execution for independent tasks
256- **Monitoring**: Track script performance and duration
257
258## Anti-Patterns
259
260### PowerShell Automation Anti-Patterns
261
262- **Sequential Everything**: Not leveraging parallel processing - use parallel execution for independent operations
263- **No Error Handling**: Scripts that fail silently - implement comprehensive try/catch/finally
264- **Hardcoded Values**: Embedding usernames, URLs in scripts - use parameters and configuration
265- **Chatty API Calls**: Making excessive API calls - batch operations and use delta queries
266
267### Security Anti-Patterns
268
269- **Over-Privileged Accounts**: Using admin accounts for routine tasks - apply least privilege principles
270- **Credential Hardcoding**: Storing passwords in scripts - use secure credential storage
271- **Audit Neglect**: Not enabling unified audit logging - enable and monitor audit logs
272- **Permission Creep**: Accumulating permissions without review - conduct regular access reviews
273
274### User Management Anti-Patterns
275
276- **Manual Provisioning**: Creating users manually instead of automation - automate user lifecycle
277- **License Waste**: Assigning licenses without tracking usage - monitor and optimize license usage
278- **Orphaned Accounts**: Leaving accounts after user departure - implement deprovisioning automation
279- **Inconsistent Naming**: No naming convention enforcement - implement and enforce naming standards
280
281### Configuration Anti-Patterns
282
283- **Configuration Drift**: Environments diverging over time - use configuration management
284- **Setting Shadow IT**: Users creating unauthorized configurations - monitor and govern settings
285- **Over-Sharing**: Excessive external sharing permissions - audit and restrict sharing settings
286- **Policy Overlap**: Multiple conflicting policies - consolidate and prioritize policies
287
288## Automation Scripts and References
289
290The M365 admin skill includes comprehensive automation scripts and reference documentation located in:
291
292### Scripts (`scripts/` directory)
293- **create_m365_users.ts**: TypeScript classes and functions for user lifecycle management, license assignment, password validation, and bulk operations
294- **configure_teams.ts**: Microsoft Teams management including team creation, channel management, member management, team settings, and archiving
295- **setup_exchange.ts**: Exchange Online administration with mailbox management, auto-reply configuration, distribution groups, calendar events, and email automation
296
297### References (`references/` directory)
298- **m365_quickstart.md**: Quick start guide with app registration, authentication, common patterns, and troubleshooting
299- **admin_patterns.md**: Comprehensive patterns for user lifecycle, Teams templates, email automation, license management, security and compliance, and backup/recovery
300
301## Output Format
302
303This skill delivers:
304- PowerShell automation scripts for M365 workloads
305- Graph API integration code and examples
306- Configuration templates and manifests
307- Audit reports and compliance summaries
308- Onboarding/offboarding workflow scripts
309- License optimization recommendations and implementations
310
311All outputs include:
312- Detailed script documentation and comments
313- Error handling and logging patterns
314- Testing instructions and validation steps
315- RBAC configuration guidance
316- Troubleshooting procedures and common issues
317- Security best practices and compliance considerations