These 20 prompts cover the repetitive work most IT admins do every week: drafting PowerShell, building Microsoft 365 and Entra ID reports, checking Intune devices, narrowing down a fault from a log, and writing the documentation nobody wants to write. Each one is original, copy-paste ready and uses placeholders you replace with your own details. Treat every answer as a draft you review and test before it touches production.
Who this is for and what you will have at the end
This is for sysadmins, help desk leads and small-business IT owners who already know the platforms and want to spend less time on first drafts. You do not need a paid API setup; the prompts work in a normal Claude chat. By the end you will have 20 reusable prompts, a short set of rules that make them reliable, a safe-use checklist for scripts that change real data, and a way to adapt any prompt to your environment.
If you want general-purpose prompts for email and spreadsheets instead, see 25 Claude prompts for work you can copy and paste. For the underlying technique, see prompt engineering basics for business users.
The rules behind every prompt below
Anthropic's prompting guide gives the principles these prompts follow. Four of them matter most for admin work.
| Rule | What Anthropic says | How it shows up in these prompts |
|---|---|---|
| Be clear and direct | Be specific about the output format and constraints; if a colleague with minimal context would be confused, Claude will be too | Every prompt states the platform, version, output and limits |
| Add context | Explain the goal behind an instruction so Claude can target the answer | Prompts say why, for example "this runs against production" |
| Use examples | A few well-crafted examples improve accuracy and consistency; Anthropic suggests 3 to 5 | Prompts that need a fixed format include one sample line |
| Use XML tags | Wrapping each type of content in its own tag, such as <instructions>, <context> and <input>, reduces misinterpretation | Pasted logs and data go inside tags |
One more habit for admins: put long pasted material, such as a log, above your question. Anthropic's long-context guidance says to place long documents and inputs near the top of the prompt, above the query, and that this improves performance.
Placeholders and what to adjust
Replace anything in square brackets. Where a prompt names Microsoft Graph PowerShell, it assumes you have installed the SDK as Microsoft documents it (Install-Module Microsoft.Graph -Scope CurrentUser -Repository PSGallery -Force) and sign in with Connect-MgGraph -Scopes plus the permission you need. Use contoso.com style placeholders instead of real tenant data.
PowerShell prompts
1. Draft a read-only report script
You are helping a Microsoft 365 administrator. Write a PowerShell 7 script using the Microsoft Graph PowerShell SDK that lists all member users with these columns: DisplayName, UserPrincipalName, AccountEnabled, CreatedDateTime. Export to a CSV file at [path].
Constraints:
- Read-only. The script must not create, change or delete anything.
- Request only the least-privileged Graph permission that is sufficient, and name it in a comment.
- Use Get-MgUser with the -Property parameter to request only the columns needed.
- Add a comment above each cmdlet saying what it does.
After the script, list every cmdlet and parameter you used so I can verify them on Microsoft Learn.Why it works: it forces a read-only boundary and asks Claude to list what to verify. Microsoft documents Get-MgUser with -Property, -Filter and -All, so you can check each against the cmdlet page.
2. Add safety switches to an existing script
<existing_code>
[paste your script]
</existing_code>
Review this PowerShell script. Rewrite it so that every command that changes data supports -WhatIf and -Confirm through [CmdletBinding(SupportsShouldProcess)], writes a log line for each object touched, and stops on the first terminating error. Show a diff-style summary of what you changed and why. Do not change the script's behavior otherwise.PowerShell documents -WhatIf as displaying a message that describes the effect of the command instead of executing it, so this is the right habit before any bulk change.
3. Explain a script you inherited
<existing_code>
[paste script]
</existing_code>
Explain this script to a new help desk technician. Give: (1) a three-sentence summary, (2) a numbered walkthrough of what each block does, (3) every external system, file path or credential it touches, (4) anything risky or that looks like a bug. Quote line numbers where you can.4. Turn a manual checklist into a script outline
I do this task by hand every week: [describe steps]. Environment: Windows Server [version], PowerShell [version], [modules].
Produce an outline, not a full script: the functions you would write, their parameters, the order they run in, what each returns and how errors are handled. Ask me up to five clarifying questions first if anything is ambiguous.Asking for questions first stops Claude from guessing about your environment.
5. Write Pester-style test cases
<function>
[paste PowerShell function]
</function>
List ten test cases for this function in a table: input, expected result, and why it matters. Include empty input, null input, a very large input and an input with special characters. Then write the Pester tests for the first five.Microsoft 365 and Entra ID prompts
6. Plan an access review report
I administer a Microsoft 365 tenant with about [number] users. Design a monthly report that shows: users who have not signed in for [number] days, accounts without multifactor authentication registered, and guest accounts older than [number] days. For each item say which Microsoft Entra or Microsoft 365 admin center page or Microsoft Graph PowerShell cmdlet would supply the data, and mark anything you are not certain exists as "verify". Do not invent portal names.The last sentence matters: it gives the model permission to say it is unsure, which makes fabricated menu paths easier to spot.
7. Review a Conditional Access policy design
<policy_design>
[describe each policy in words: users, apps, conditions, grant controls, exclusions]
</policy_design>
Act as a reviewer. Identify gaps: lockout risks, missing break-glass account exclusions, overlapping or contradictory policies, and legacy authentication coverage. Return a table with Finding, Risk, Suggested change. Flag any suggestion that could lock admins out so I can test it in report-only mode first.Never paste exported policy JSON that contains tenant IDs without redacting them first.
8. Draft a license cleanup plan
Context: [number] users, license types [list SKUs by friendly name], a goal of reducing spend without removing access anyone needs.
Create a step-by-step plan to find unused licenses (for example users inactive for [number] days), confirm with managers, and reclaim them. Include a template email to managers and a rollback step if someone loses access in error. Keep it to one page.9. Write a new-hire and leaver checklist
Create a checklist for [onboarding / offboarding] in a Microsoft 365 environment with Entra ID and Intune. Group the steps by system (identity, mailbox, files, devices, apps). For each step include the owner role and whether it can be automated. Mark steps that carry data-loss risk, for example deleting a mailbox, with "confirm with manager first".Intune and endpoint prompts
10. Design a pilot ring rollout
I need to deploy [app, policy or update setting] to about [number] Windows devices managed by Intune. Propose a three-ring rollout (pilot, broad, everyone) with ring sizes, how long to wait between rings, what to monitor, and the exact conditions under which I should stop. Present it as a table, then a short rollback plan.11. Draft a compliance policy proposal
Draft a device compliance policy proposal for [Windows / iOS / Android] devices used by [department]. List each setting you recommend, why, and the user impact. Separate "must have" from "nice to have". Tell me which settings commonly cause help desk calls so I can warn users in advance.12. Query managed devices with Graph PowerShell
Write a read-only PowerShell 7 snippet using the Microsoft Graph PowerShell SDK that lists Intune managed devices and exports DeviceName, OperatingSystem, OSVersion and LastSyncDateTime to CSV. Use Get-MgDeviceManagementManagedDevice with -All. Name the Graph permission it needs. Then give two ways to sort the output so the devices that have not synced the longest appear first. List every cmdlet and parameter used so I can verify them.Microsoft's cmdlet page documents -All, -Filter, -Property and -Sort for this cmdlet, so the checks are quick.
13. Write end-user instructions for a change
Write instructions for non-technical staff explaining [change, for example "Company Portal will ask you to install an update"]. Reading level: grade 8. Include what they will see on screen in words, how long it takes, what to do if it fails and who to contact. Under 200 words. No jargon.Troubleshooting prompts
14. Narrow down a fault from a log
<log>
[paste redacted log excerpt]
</log>
<context>
Product and version: [..]. What changed recently: [..]. What worked before: [..]. What I already tried: [..].
</context>
List the three most likely causes ranked by probability, the single fastest test that would confirm or rule out each one, and what I would see if the test confirms it. Say plainly where the log does not contain enough information.15. Interpret an error message
I got this error in [product]: "[exact message]". It happens when [action]. Explain in plain language what the error means, the common causes, and a safe order in which to check them, from least to most disruptive. Tell me which fixes change settings so I know what to back up first.16. Build a troubleshooting decision tree
Build a decision tree for the help desk for the symptom "[symptom]". Use a text diagram with yes/no branches, no more than eight questions, and end every branch with a specific action or an escalation instruction that names what information to collect.Use a text format request like this when you want something you can paste into a wiki without an image.
17. Write a post-incident review
<timeline>
[paste incident notes with times]
</timeline>
Write a blameless post-incident review: summary, timeline, impact, root cause, what went well, what went badly, and action items with an owner role and a due date placeholder. Do not speculate about causes the timeline does not support; list them under "open questions" instead.Documentation and communication prompts
18. Convert notes into a runbook
<notes>
[paste rough notes]
</notes>
Turn these into a runbook with: purpose, prerequisites, numbered steps, expected result for each step, rollback, and a "when to escalate" section. Mark any step where my notes are unclear with [CLARIFY] rather than guessing.19. Write a change request
Draft a change request for [change]. Include: reason, systems affected, risk level with justification, test evidence placeholder, implementation steps, rollback steps, communication plan and the maintenance window as [date/time]. Keep it under one page.20. Write an outage notice
Write a status message for [audience] about [issue]. Facts I know: [list]. Facts I do not know yet: [list]. Next update at [time]. Tone: calm and plain. Do not state a cause or an end time unless I gave one. Give a short version for chat and a longer version for email.Safe-use checklist for admins
Before you run anything Claude produced, work through this list.
- Read the whole script; do not run what you cannot explain.
- Verify each cmdlet, parameter and permission scope on learn.microsoft.com. A model can produce something that looks right but does not exist.
- Run read-only versions first and review the output.
- Use
-WhatIfon anything that changes data, then run against a test account or pilot group. - Keep secrets, tokens and real user data out of the prompt.
- Log what the script changes, and keep a rollback.
If you let Claude read content you do not control, such as tickets or emails, treat that content as untrusted; the prompt injection defense checklist covers why.
Anthropic also notes that, without guidance, a model working with tools might take actions that are hard to reverse or affect shared systems. Its guidance is to tell the model to ask before destructive, hard-to-reverse or externally visible actions. Add a line such as "Ask me before any step that deletes data or changes a shared system" to any prompt used in an agentic tool.
Adapting a prompt to your environment
- Replace the placeholders with your versions: PowerShell 5.1 and 7 behave differently, and Microsoft recommends PowerShell 7 or later for the Graph SDK.
- Add one example of the output you want if the format matters.
- State the boundary: read-only, pilot group only, or no changes outside business hours.
- Ask for the verification list: every cmdlet, setting and portal path used.
- Save the prompts that work in a Claude Project so your team starts from the same wording; see Claude Projects for a team knowledge base.
What we checked
- Opened the Claude prompting best practices page on platform.claude.com on 2026-11-18. Confirmed the sections "Be clear and direct", "Add context to improve performance", "Use examples effectively", "Structure prompts with XML tags" and "Long context prompting", and the advice to include 3 to 5 examples and to put long documents above the query.
- Opened the Get-MgUser reference on learn.microsoft.com on 2026-11-18. Confirmed that
-All,-Filter,-Property,-Search,-Sortand-Topexist and that the page's Example 1 usesConnect-MgGraph -Scopes 'User.Read.All'. Its documented output forGet-MgUser -All | Format-List ID, DisplayName, Mail, UserPrincipalNamelists Id, DisplayName, Mail and UserPrincipalName fields, for example DisplayNameAdele Vancewith[email protected]. - Opened the Get-MgDeviceManagementManagedDevice reference on 2026-11-18. Confirmed it supports
-All,-Filter,-Property,-Sort,-Topand-Skip. - Opened the Microsoft Graph PowerShell SDK installation page on 2026-11-18. Confirmed the command
Install-Module Microsoft.Graph -Scope CurrentUser -Repository PSGallery -Forceand the recommendation to use PowerShell 7 or later. - Opened about_CommonParameters (PowerShell 7.6) on 2026-11-18. Documented output for
Remove-Item Date.csv -WhatIfisWhat if: Performing operation "Remove File" on Target "C:\ps-test\date.csv". - Counted the prompts: 5 PowerShell, 4 Microsoft 365 and Entra ID, 4 Intune, 4 troubleshooting and 3 documentation, which totals 20.
- Not checked: we did not run any of the 20 prompts against Claude or run any generated script in a tenant, so the example outputs a prompt produces will vary. The prompts are original and general; adjust them to your data.
Last tested: 2026-11-18
Comments
Questions and tips are welcome. Comments are checked by the EpiFive team before they appear; please do not share passwords, phone numbers or other private details.