/servicedesk-runbooks:servicedesk-runbooksfrom servicedesk-runbooks
Provides safe, structured M365 service desk workflows for common IT tickets like shared mailbox access, MFA reset, file recovery, password reset, group membership, license assignment, and account lifecycle using Graph API and Exchange PowerShell.
Ships in servicedesk-runbooks. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill provides safe, structured workflows for the most common M365 IT support tickets. Each runbook follows a consistent pattern with pre-checks, approval gates, execution, verification, and end-user communication.
https://graph.microsoft.com/v1.0
All Graph API endpoints below are relative to this base URL.
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /users/{id} | Get user details |
| PATCH | /users/{id} | Update user properties |
| GET | /users/{id}/memberOf | List user's group memberships |
| POST | /users/{id}/assignLicense | Assign/remove licenses |
| GET | /users/{id}/licenseDetails | Get user's license details |
| GET | /users/{id}/authentication/methods | List authentication methods |
| DELETE | /users/{id}/authentication/microsoftAuthenticatorMethods/{methodId} | Remove Authenticator |
| DELETE | /users/{id}/authentication/phoneMethods/{methodId} | Remove phone method |
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /groups/{id} | Get group details |
| GET | /groups/{id}/members | List group members |
| POST | /groups/{id}/members/$ref | Add member to group |
| DELETE | /groups/{id}/members/{userId}/$ref | Remove member from group |
| GET | /groups/{id}/owners | List group owners |
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /users/{id}/drive/root/delta | List file changes |
| POST | /users/{id}/drive/items/{itemId}/restore | Restore deleted file |
| GET | /users/{id}/drive/items/{itemId}/versions | List file versions |
| POST | /users/{id}/drive/items/{itemId}/versions/{versionId}/restoreVersion | Restore to version |
Every runbook follows this structure:
| Runbook | Pre-Check API Call | What to Verify |
|---|---|---|
| Shared Mailbox Access | Get-Mailbox -Identity "[email protected]" | Mailbox exists and is shared type |
| MFA Reset | GET /users/{id}/authentication/methods | User exists, list current methods |
| File Recovery | GET /users/{id}/drive/root/search(q='{filename}') | File exists in recycle bin |
| Password Reset | GET /users/{id}?$select=onPremisesSyncEnabled | Check if cloud-only (not synced) |
| Group Membership | GET /groups/{id}/members | Group exists, check current membership |
| License Assignment | GET /subscribedSkus | Verify available licenses in tenant |
| Account Disable | GET /users/{id}?$select=accountEnabled,assignedLicenses | User exists and is currently enabled |
Pre-checks:
SharedMailboxExecution (Exchange PowerShell):
# Full Access
Add-MailboxPermission -Identity "[email protected]" -User "[email protected]" -AccessRights FullAccess -AutoMapping $true
# Send As
Add-RecipientPermission -Identity "[email protected]" -Trustee "[email protected]" -AccessRights SendAs -Confirm:$false
# Send on Behalf
Set-Mailbox -Identity "[email protected]" -GrantSendOnBehalfTo @{Add="[email protected]"}
Verification:
Get-MailboxPermission -Identity "[email protected]" | Where-Object {$_.User -like "*user*"}
Pre-checks:
Execution (Graph API):
# List current methods
GET /users/{userId}/authentication/methods
# Remove Authenticator app
DELETE /users/{userId}/authentication/microsoftAuthenticatorMethods/{methodId}
# Remove phone method
DELETE /users/{userId}/authentication/phoneMethods/{methodId}
Verification:
GET /users/{userId}/authentication/methods
Confirm only password method remains.
Pre-checks:
Execution (Graph API):
POST /users/{userId}/drive/items/{itemId}/restore
Or for version restore:
POST /users/{userId}/drive/items/{itemId}/versions/{versionId}/restoreVersion
Or via SharePoint recycle bin:
Restore-PnPRecycleBinItem -Identity {itemId} -Force
Pre-checks:
Execution (Graph API):
PATCH /users/{userId}
{
"passwordProfile": {
"forceChangePasswordNextSignIn": true,
"password": "{secureRandomPassword}"
}
}
Important: For synced accounts (onPremisesSyncEnabled: true), password must be reset in on-premises Active Directory, not via Graph API.
Pre-checks:
GET /groups/{groupId}GET /users/{userId}GET /groups/{groupId}/membersExecution — Add Member (Graph API):
POST /groups/{groupId}/members/$ref
{
"@odata.id": "https://graph.microsoft.com/v1.0/users/{userId}"
}
Execution — Remove Member:
DELETE /groups/{groupId}/members/{userId}/$ref
Verification:
GET /groups/{groupId}/members?$filter=id eq '{userId}'
Dynamic group check:
GET /groups/{groupId}?$select=groupTypes,membershipRule
If groupTypes contains DynamicMembership, membership is managed by the membershipRule — manual add/remove is not supported.
Pre-checks:
GET /users/{userId}GET /subscribedSkusprepaidUnits.enabled - consumedUnits > 0 for the target SKUGET /users/{userId}/licenseDetailsExecution — Assign License (Graph API):
POST /users/{userId}/assignLicense
{
"addLicenses": [
{
"skuId": "{skuId}",
"disabledPlans": []
}
],
"removeLicenses": []
}
Execution — Remove License:
POST /users/{userId}/assignLicense
{
"addLicenses": [],
"removeLicenses": ["{skuId}"]
}
Execution — Assign with Disabled Plans:
POST /users/{userId}/assignLicense
{
"addLicenses": [
{
"skuId": "{skuId}",
"disabledPlans": [
"efb87545-963c-4e0d-99df-69c6916d9eb0",
"a23b959c-7ce8-4e57-9140-b90eb88a9e97"
]
}
],
"removeLicenses": []
}
Verification:
GET /users/{userId}/licenseDetails
Pre-checks:
GET /users/{userId}?$select=accountEnabled,displayName,assignedLicensesExecution — Disable Account:
PATCH /users/{userId}
{
"accountEnabled": false
}
Execution — Revoke Sessions (immediately block access):
POST /users/{userId}/revokeSignInSessions
Execution — Enable Account:
PATCH /users/{userId}
{
"accountEnabled": true
}
Verification:
GET /users/{userId}?$select=accountEnabled
Full offboarding sequence:
PATCH /users/{id} — disable accountPOST /users/{id}/revokeSignInSessions — revoke all active sessionsPOST /users/{id}/assignLicense — remove licenses (save SKU IDs for potential re-enable)DELETE /groups/{gid}/members/{uid}/$refSend an Adaptive Card to a Teams channel or chat for manager approval:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Service Desk Request - Approval Needed",
"weight": "bolder",
"size": "medium"
},
{
"type": "FactSet",
"facts": [
{ "title": "Request", "value": "Add [email protected] to Finance group" },
{ "title": "Requester", "value": "Jane Smith" },
{ "title": "Ticket", "value": "INC-2026-0042" },
{ "title": "Urgency", "value": "Normal" }
]
}
],
"actions": [
{ "type": "Action.Submit", "title": "Approve", "data": { "action": "approve" } },
{ "type": "Action.Submit", "title": "Deny", "data": { "action": "deny" } }
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5"
}
Create a Planner task for tracking and approval:
POST /planner/tasks
{
"planId": "{planId}",
"bucketId": "{approvalBucketId}",
"title": "Approve: Add [email protected] to Finance group [INC-2026-0042]",
"assignments": {
"{managerId}": {
"@odata.type": "#microsoft.graph.plannerAssignment",
"orderHint": " !"
}
},
"dueDateTime": "2026-03-03T17:00:00Z"
}
| Method Type | Graph API Path | Description |
|---|---|---|
| Microsoft Authenticator | /authentication/microsoftAuthenticatorMethods | Push notification / TOTP |
| Phone (SMS/Voice) | /authentication/phoneMethods | SMS or voice call |
| FIDO2 Security Key | /authentication/fido2Methods | Hardware security key |
| Windows Hello | /authentication/windowsHelloForBusinessMethods | Biometric/PIN |
/authentication/emailMethods | Email OTP | |
| Temporary Access Pass | /authentication/temporaryAccessPassMethods | Time-limited passcode |
| Password | /authentication/passwordMethods | Traditional password |
| Software OATH | /authentication/softwareOathMethods | Third-party TOTP app |
Hi [Name],
Your access to [resource] has been set up. Here's what you need to know:
- [Specific instructions for accessing the resource]
- Changes may take up to [time] to take effect
- If you have any issues, contact [support channel]
Best regards,
IT Support
Hi [Name],
Your multi-factor authentication has been reset. On your next sign-in:
1. You'll be prompted to set up a new verification method
2. We recommend using the Microsoft Authenticator app
3. Visit https://mysignins.microsoft.com to manage your methods
If you didn't request this change, contact IT immediately.
Best regards,
IT Support
Hi [Name],
Your password has been reset. A temporary password has been provided to you securely.
On your next sign-in:
1. Enter the temporary password
2. You'll be prompted to create a new password
3. Your new password must meet the organization's complexity requirements
Never share your password with anyone. IT will never ask for your password.
Best regards,
IT Support
Hi [Requester],
The account for [Name] has been disabled as requested.
Actions taken:
- Account disabled and sign-in blocked
- Active sessions revoked
- Licenses removed: [list]
- Group memberships documented for potential future re-enable
Ticket reference: [ticket-id]
Best regards,
IT Support
| Runbook | Permission / Role |
|---|---|
| Shared mailbox access | Exchange Administrator |
| MFA reset | Authentication Administrator |
| File recovery | Sites.ReadWrite.All or SharePoint Administrator |
| Password reset | User Administrator (or Helpdesk Administrator for non-admin users) |
| Group membership | GroupMember.ReadWrite.All or Group.ReadWrite.All |
| License assignment | User.ReadWrite.All + Directory.ReadWrite.All (or License Administrator role) |
| Account disable/enable | User Administrator or User.ReadWrite.All |
| Revoke sessions | User Administrator or User.ReadWrite.All |
| Status Code | Meaning | Common Cause |
|---|---|---|
| 400 Bad Request | Malformed request | Invalid user ID, service plan conflict, dynamic group member add |
| 401 Unauthorized | Authentication failure | Expired token, missing scope consent |
| 403 Forbidden | Insufficient permissions | Missing required role — check delegation hierarchy |
| 404 Not Found | Resource not found | Invalid user/group ID, deleted file not in recycle bin |
| 409 Conflict | Operation conflict | License already assigned, user already member of group |
| 429 Too Many Requests | Throttled | Implement exponential backoff with Retry-After header |
| Error Code | Meaning | Resolution |
|---|---|---|
CountViolation | No available licenses | Purchase additional licenses or free up existing ones |
MutuallyExclusiveViolation | Conflicting service plans | Remove conflicting license before assigning new one |
DependencyViolation | Required service plan missing | Assign prerequisite license first |
ProhibitedInUsageLocationViolation | Usage location not set | PATCH /users/{id} with usageLocation before license assignment |
If a multi-step runbook fails partway through:
forceChangePasswordNextSignIn: true| Topic | File |
|---|---|
| Ticket lifecycle, ServiceNow/Jira integration, Graph API notifications, Dataverse schema, SLA, triage | references/ticket-workflows.md |
| Power Automate approvals, Teams adaptive cards, parallel/sequential approvals, delegation, audit trail | references/approval-gates.md |
| Time-based escalation, skill routing, manager chain, cross-team, vendor, executive bridge, PIR | references/escalation-patterns.md |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub thelobbi/claude-m --plugin servicedesk-runbooksOther plugins' skills for the same job