Killing Local Admin Password Tickets with Windows LAPS
Local admin password reset requests flood L1 queues; Windows LAPS with Graph API self-service retrieval and audit logging eliminates them entirely.

Advertising disclosure: this article includes partner links. KBY may earn a commission if you sign up or buy through one, at no extra cost to you. How we make money.
Underlined words are defined in the KBY Lexicon. Tap or click one to see what it means.
Every local administrator password kept in a spreadsheet is a record someone has to protect, rotate and audit by hand. That work grows with the estate and leaves little proof that rotation happened. Here is how Windows LAPS, Graph-based retrieval and Azure Monitor logging take the technician out of the request while every lookup stays justified and recorded.
#From password spreadsheets to self-service retrieval
The old way looks like this: a field engineer needs local admin rights on a laptop to install a legacy driver, or a user has locked themselves out of a break-glass local account. They raise a ticket.
An L1 technician verifies identity over the phone, digs through a spreadsheet or a legacy password vault, manually rotates the password afterwards (if they remember), and logs the change in a separate audit trail that nobody reads until an auditor asks for it eighteen months later.
Multiply that by every laptop in the estate and you have a queue that never empties, a spreadsheet that is itself a security incident waiting to happen, and zero real-time proof that the password was actually rotated.
The new way removes the technician from the transaction entirely. Windows LAPS (Local Administrator Password Solution), now a native Windows feature backed by Entra ID or Active Directory, rotates and stores the local administrator password automatically.
Layered with a Microsoft Graph API self-service retrieval flow, Conditional Access, and Azure Monitor logging, a helpdesk technician retrieves the password themselves (end users only after an approval step), with every retrieval justified and logged.
The password is not time-limited on retrieval: it stays valid until it is rotated automatically after the managed account has been used (Windows LAPS post-authentication actions) or at the next scheduled rotation. The ticket is engineered out of existence before it is ever raised.
#Licences, roles and app permissions to have in place
- Windows 10 22H2 or Windows 11 devices, Entra ID joined or Hybrid joined, enrolled in Microsoft Intune.
- Microsoft Intune licence (Intune Plan 1 or Microsoft 365 E3/E5) covering the target device group.
- Intune role: Intune Administrator or a custom Intune role for endpoint security policies, for the engineer configuring policy. Do not use Global Administrator for day-to-day LAPS work.
- Local Administrator Password Solution reader role (custom Entra role scoped to microsoft.directory/deviceLocalCredentials/password/read) assigned to the helpdesk security group, not to individual technicians.
- Graph API application registration with DeviceLocalCredential.Read.All permission, admin-consented, used only by the self-service automation, never by a human account directly.
- Conditional Access policy requiring multifactor authentication and a compliant device for sign-in to the self-service front end (user Conditional Access does not apply to the automation’s app-only Graph token).
- Azure Monitor or Sentinel workspace for audit ingestion.
#Rolling out LAPS and the retrieval flow
#Step 1 to 3: Deploy the LAPS policy
Step 1. Action: Create an account protection policy in Intune (Endpoint security, then Account protection, profile Local admin password solution (Windows LAPS)), targeting a pilot group of no more than 25 devices. Expected result: the policy shows under Endpoint security then Account protection. Evidence to capture: screenshot of the policy summary blade with assignment scope visible.
Step 2. Action: Configure password rotation in the Intune LAPS profile with the Windows LAPS CSP settings below (name and value, not a Graph request body). The named account must already exist: Windows LAPS only creates or renames an account through automatic account management, which needs Windows 11 24H2 or later.
1{
2 "BackupDirectory": 1,
3 "PasswordAgeDays": 7,
4 "AdministratorAccountName": "kby-svc-laps",
5 "PasswordComplexity": 4,
6 "PasswordLength": 20,
7 "PostAuthenticationActions": 3,
8 "PostAuthenticationResetDelay": 1
9}BackupDirectory 1 is Entra ID; PasswordComplexity 4 is upper case, lower case, numbers and specials; PostAuthenticationActions 3 resets the password and logs off the account; PostAuthenticationResetDelay is in hours (0 disables it).
Get-LocalUser -Name "kby-svc-laps" | Select-Object Name, Enabled, PasswordLastSetExpected output:
1Name Enabled PasswordLastSet
2---- ------- ---------------
3kby-svc-laps True 10/03/2025 09:14:02Step 3. Action: Confirm the password is escrowed correctly in Entra ID by querying the Graph endpoint from an admin session (not the automation account).
1# Get-LapsAADPassword is in the Windows LAPS module, not the Microsoft Graph SDK,
2# but it wraps the Microsoft Graph PowerShell library, which must be installed.
3Import-Module LAPS
4Connect-MgGraph -Scopes "DeviceLocalCredential.Read.All","Device.Read.All"
5# -DeviceIds accepts a device name or an Entra device ID
6Get-LapsAADPassword -DeviceIds "PC-PILOT-01" | ConvertTo-Json#Step 4 to 6: Build the self-service retrieval automation
Step 4. Action: Register an app in Entra ID named laps-self-service-bot, grant it DeviceLocalCredential.Read.All (application permission, admin consented), and store its client secret in Azure Key Vault rather than in the automation script.
1az ad app create --display-name "laps-self-service-bot" \
2 --sign-in-audience AzureADMyOrg
3# Look up the app role ID for DeviceLocalCredential.Read.All
4az ad sp show --id 00000003-0000-0000-c000-000000000000 \
5 --query "appRoles[?value=='DeviceLocalCredential.Read.All'].id" -o tsv
6az ad app permission add --id {appId} \
7 --api 00000003-0000-0000-c000-000000000000 \
8 --api-permissions {DeviceLocalCredentialReadAllPermissionId}=Role
9az ad app permission admin-consent --id {appId}
10# Create a client secret and store it straight in Key Vault
11az keyvault secret set --vault-name {vaultName} --name laps-bot-client-secret \
12 --value "$(az ad app credential reset --id {appId} --query password -o tsv)"Step 5. Action: Deploy a lightweight Azure Function (Python) that the technician or end user calls through a Teams or ServiceNow front end.
The function must reject a missing justification and check the requester is in the approved helpdesk security group via Graph before it retrieves the password; the sample below does both, which needs the app to hold User.ReadBasic.All and GroupMember.Read.All as well.
Take the requester’s identity from the front end’s authenticated sign-in, never from a field the requester types, and add an approval step before any end user receives a password. Retrieval does not rotate the password: rotation follows from the post-authentication action once the account is used, or from Intune’s Rotate local admin password device action.
1import base64
2import os
3import requests
4from msal import ConfidentialClientApplication
5
6TENANT_ID = os.environ["TENANT_ID"]
7CLIENT_ID = os.environ["CLIENT_ID"]
8CLIENT_SECRET = os.environ["CLIENT_SECRET"]
9AUTHORITY = f"https://login.microsoftonline.com/{TENANT_ID}"
10SCOPE = ["https://graph.microsoft.com/.default"]
11
12def get_token(scopes=SCOPE):
13 app = ConfidentialClientApplication(
14 CLIENT_ID, authority=AUTHORITY, client_credential=CLIENT_SECRET
15 )
16 result = app.acquire_token_for_client(scopes=scopes)
17 return result["access_token"]
18
19HELPDESK_GROUP_ID = os.environ["HELPDESK_GROUP_ID"]
20
21def retrieve_laps_password(device_id, requester_upn, justification):
22 # Reads the current password; it does not rotate it.
23 if len(justification.strip()) < 20:
24 raise PermissionError("A business justification is required")
25 token = get_token()
26 headers = {"Authorization": f"Bearer {token}"}
27 check = requests.post(
28 f"https://graph.microsoft.com/v1.0/users/{requester_upn}/checkMemberGroups",
29 headers=headers, json={"groupIds": [HELPDESK_GROUP_ID]}, timeout=15)
30 check.raise_for_status()
31 if HELPDESK_GROUP_ID not in check.json().get("value", []):
32 raise PermissionError("Requester is not in the approved helpdesk group")
33
34 url = f"https://graph.microsoft.com/v1.0/directory/deviceLocalCredentials/{device_id}?$select=credentials"
35 response = requests.get(url, headers=headers, timeout=15)
36 response.raise_for_status()
37 body = response.json()
38 info = body.get("value", body)
39 credentials = info.get("credentials") or []
40 if not credentials:
41 raise LookupError("No LAPS password backed up for this device")
42 # Newest backup is the current password; Graph returns it base64-encoded (UTF-16LE)
43 latest = max(credentials, key=lambda c: c["backupDateTime"])
44 password = base64.b64decode(latest["passwordBase64"]).decode("utf-16-le")
45
46 audit_event = {
47 "deviceId": device_id,
48 "requester": requester_upn,
49 "justification": justification,
50 "action": "laps_retrieve"
51 }
52 send_audit_event(audit_event)
53 return {"accountName": latest["accountName"], "password": password}
54
55def send_audit_event(event):
56 log_analytics_url = os.environ["LOG_ANALYTICS_INGEST_URL"]
57 # Logs Ingestion API (DCR stream URL); the app needs Monitoring Metrics Publisher on the DCR
58 monitor_token = get_token(["https://monitor.azure.com/.default"])
59 resp = requests.post(log_analytics_url, json=[event], timeout=10,
60 headers={"Authorization": "Bearer " + monitor_token})
61 resp.raise_for_status() # no audit row, no passwordStep 6. Action: Wire the function to a Teams Adaptive Card or ServiceNow catalog item so the requester supplies a device ID and justification without ever touching the Graph API directly.
1{
2 "type": "AdaptiveCard",
3 "version": "1.5",
4 "body": [
5 { "type": "TextBlock", "text": "LAPS Password Self-Service", "weight": "Bolder" },
6 { "type": "Input.Text", "id": "deviceId", "label": "Device ID" },
7 { "type": "Input.Text", "id": "justification", "label": "Business justification" }
8 ],
9 "actions": [
10 { "type": "Action.Execute", "title": "Retrieve Password", "verb": "retrieveLaps" }
11 ]
12}#Step 7: Lock it down with Conditional Access
Action: create a Conditional Access policy targeting the app registration that protects the self-service front end and Function App, scoped to the helpdesk security group, requiring MFA and a compliant or Entra-hybrid-joined device before a token can be issued for it. The function’s own app-only Graph token cannot satisfy MFA, so Conditional Access gates the requester, not the Graph call.
#Proving rotation, auditing and resets work
- Confirm password rotation cadence by querying PasswordLastSet on three pilot devices more than seven days apart; expect a new timestamp each time.
- Confirm every retrieval produces exactly one audit row in Log Analytics with requester UPN, device ID, and justification populated (no nulls).
- Confirm the post-authentication reset fires by signing in with the managed account and checking PasswordLastSet after the configured delay (1 hour in the sample policy); retrieval alone does not trigger it.
- Run a query in Log Analytics to prove deflection is measurable:
Following along? Tap a step’s number to tick it off.
1LapsAuditEvents_CL
2| where TimeGenerated > ago(30d)
3| summarize RetrievalCount = count() by bin(TimeGenerated, 1d)#Backing out of the pilot
If the pilot causes lockouts or unexpected account renames, remove device group assignment from the Windows LAPS policy in Intune, which halts further rotation but does not revert the current password. Intune’s Rotate local admin password device action generates a new random password and cannot set a known one.
To return to manual management, unassign the policy, retrieve the last backed-up password, and set a new password with a signed PowerShell script run through Intune or Configuration Manager. Rolling back only touches the pilot group (25 devices), and the change takes effect on each device at its next policy sync.
#When to escalate to a person
- Escalate to L3/Identity team if Graph calls return HTTP 403 after a valid Conditional Access grant. This indicates a permission or consent drift on the app registration, not a user error.
- Escalate immediately if the same device ID generates more than five retrieval events within one hour. This is the trigger that should wake a human technician, since it indicates either automation misuse or credential compromise.
- Escalate if the post-authentication reset (PostAuthenticationResetDelay) repeatedly fails to fire (password unchanged after the configured delay). This points to a device sync failure and should be treated as a compliance gap, not cosmetic.
- Monitoring signal: an Azure Monitor alert rule on the LapsAuditEvents_CL table firing when retrieval count per device exceeds the five-per-hour threshold, routed to the security operations Teams channel.
#Counting the tickets that stop arriving
Baseline the current state before rollout: export the last 90 days of tickets tagged local admin password or account lockout – local from the ITSM tool and record the monthly average. After rollout, track two figures monthly: total self-service retrievals (from the Log Analytics query above) and residual tickets still requiring a human technician.
A healthy deflection curve shows residual tickets dropping toward zero within 60 days while self-service retrievals stabilise at a predictable weekly volume. Present both figures side by side in the monthly service review; a ticket count that stays flat while self-service volume climbs is a signal the self-service flow is not yet discoverable, not that the demand has disappeared.
#Who needs which role, and how far a bad policy reaches
Minimum role for ongoing operation is an Intune role that can manage endpoint security policies for policy changes and the scoped custom LAPS reader role for helpdesk staff triaging escalations manually. Test scope for any policy change should never exceed a pilot ring of 25 to 50 devices.
A misconfigured rotation policy can at worst cost local admin access on the affected devices. You recover it by retrieving the backed-up password or rotating it with Intune’s device action, and domain or Entra ID identities are not affected.
#References
For the underlying feature and Graph schema, see Microsoft’s Windows LAPS overview documentation and the Microsoft Graph deviceLocalCredentialInfo resource reference.
#Related reading
Configuring Entra ID PIM for Just-in-Time Admin Access
Decommissioning Windows Devices in Intune: Retire, Wipe, Cleanup
Tracing an Endpoint and Device Management Problem with Microsoft Intune
Conditional Access
Evidence trail
Sources and verification
Primary documentation and external technical references used in this article.
About this page
Credited to
Dates
Published
Found this useful? Follow KBY for more like it.
Recommended reading
More from KBY that goes with this article.
Related articles
Device Management
Kandji vs Jamf Pro: Pilot Both MDMs on Real Macs and Score Them
Score Kandji and Jamf Pro on enrolment, app deployment, compliance and reporting, using the same test Macs and criteria fixed before the pilot.
ReadDevice Management
Choosing Miradore, Jamf Pro or Kandji for Mixed Fleets
Compare Miradore, Jamf Pro and Kandji for Mac, Windows, iPhone and Android fleets, then choose with a scoped pilot and a clear pass/fail checklist.
ReadEnterprise IT Management
Part 6: Reset, Retire and Reuse Windows Autopilot Devices Safely in Intune
Autopilot Reset, Wipe and Fresh Start compared, a handover to a new user, and the safe order for retiring a device.
ReadEnterprise IT Management
Detect Microsoft 365 Configuration Drift with Tenant Configuration Management: Snapshot, Baseline and Monitor
Snapshot approved Microsoft 365 settings, monitor them against that baseline every six hours, and read each drift through Microsoft Graph.
ReadDiscover more
Graduate Learning
- TutorialWorking Out Why an Intune App Install Failed on One Windows Device
- TutorialListing Disabled Users in Microsoft Entra ID with Read-Only Microsoft Graph PowerShell
- TutorialRevoking a User’s Sessions in Microsoft Entra ID After a Suspected Account Compromise
- TutorialNarrowing an Intune Policy to the Right Devices with an Assignment Filter
Ops Playbook
- PlaybookInstall containerd on Autopilot Laptops Without Rebooting Mid-Provisioning
- PlaybookReplace Remote-Control Sessions With Intune Device Query for First-Line Windows Triage
- PlaybookProve Your Entra ID Break-Glass Accounts Still Work With a Quarterly Sign-In Drill
- PlaybookFind the Windows Apps That Crash Most With Intune’s Application Reliability Report
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
Operate smarter, with fewer recurring tickets.
Receive new operational playbooks, incident-prevention guidance, automation scripts and recovery runbooks.


Comments
Add a thoughtful note on Killing Local Admin Password Tickets with Windows LAPS. Comments are checked for spam and held for moderation before appearing.