Files
claudetools/temp/reset-password.ps1
Mike Swanson fa15b03180 sync: Auto-sync from ACG-M-L5090 at 2026-03-10 19:11:00
Synced files:
- Quote wizard frontend (all components, hooks, types, config)
- API updates (config, models, routers, schemas, services)
- Client work (bg-builders, gurushow)
- Scripts (BGB Lesley termination, CIPP, Datto, migration)
- Temp files (Bardach contacts, VWP investigation, misc)
- Credentials and session logs
- Email service, PHP API, session logs

Machine: ACG-M-L5090
Timestamp: 2026-03-10 19:11:00

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 19:59:08 -07:00

39 lines
1.8 KiB
PowerShell

# Get CIPP auth token
$body = @{
client_id = '420cb849-542d-4374-9cb2-3d8ae0e1835b'
client_secret = 'MOn8Q~otmxJPLvmL~_aCVTV8Va4t4~SrYrukGbJT'
scope = 'api://420cb849-542d-4374-9cb2-3d8ae0e1835b/.default'
grant_type = 'client_credentials'
}
$token = (Invoke-RestMethod -Uri 'https://login.microsoftonline.com/ce61461e-81a0-4c84-bb4a-7b354a9a356d/oauth2/v2.0/token' -Method POST -Body $body).access_token
Write-Host "Token obtained: $($token.Substring(0,20))..."
$headers = @{ Authorization = "Bearer $token" }
$baseUrl = 'https://cippcanvb.azurewebsites.net/api'
# Test auth - list tenants
try {
$tenants = Invoke-RestMethod -Uri "$baseUrl/ListTenants" -Headers $headers
Write-Host "Auth works. Tenants found: $($tenants.Count)"
} catch {
Write-Host "ListTenants failed: $($_.Exception.Message)"
}
# Try ExecResetPass with query string approach (some CIPP endpoints use GET params)
try {
$uri = "$baseUrl/ExecResetPass?TenantFilter=sonorangreenllc.com&ID=lesley@bgbuildersllc.com&password=Builder2026!&MustChange=false"
$result = Invoke-RestMethod -Uri $uri -Headers $headers
Write-Host "Result: $($result | ConvertTo-Json -Depth 5)"
} catch {
Write-Host "GET approach failed: $($_.Exception.Message)"
# Try as POST with different body format
try {
$resetBody = '{"TenantFilter":"sonorangreenllc.com","ID":"lesley@bgbuildersllc.com","password":"Builder2026!","MustChange":false}'
$result = Invoke-RestMethod -Uri "$baseUrl/ExecResetPass" -Method POST -Headers $headers -Body $resetBody -ContentType 'application/json'
Write-Host "POST Result: $($result | ConvertTo-Json -Depth 5)"
} catch {
Write-Host "POST also failed: $($_.Exception.Response.StatusCode) - $($_.Exception.Message)"
}
}