<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->

# API Reference — Detecting Identity Sprawl

## Commands

| Command | Description |
|---|---|
| `Get-MgUser -Filter lastSignIn` | Find dormant Azure AD accounts |
| `Search-ADAccount -AccountInactive` | Find inactive AD accounts |
| `Get-MgServicePrincipal` | List all service principals |
| `Get-MgApplication` | List all app registrations |
| `Get-MgUserAppRoleAssignment` | List user app assignments |
| `Remove-MgUser` | Delete an Azure AD user |
| `Disable-ADAccount` | Disable an AD account |

## Agent Script

```bash
# node agent.js detect
# node agent.js analyze --user <value>
# node agent.js remediate --type <value>
```
