sync: Dataforth sync fixes, TestDataDB stability, and client scripts

Dataforth DOS:
- TestDataDB: singleton DB connection fix (crash prevention), WAL mode,
  WinSW service config, backup script, uncaught exception handlers
- Sync-FromNAS.ps1: Get-NASFileList temp file approach to avoid SSH
  stdout deadlock, *> $null output suppression, 8.3 filename filter
  for PUSH phase, backslash-escaped SCP paths, rename-to-.synced
- import.js: INSERT OR REPLACE for re-tested devices
- Full import run: 1,028,275 -> 1,632,793 records, indexes added
- Deploy script for sync fixes to AD2

Client scripts (temp/):
- BG Builders: Lesley account check, MFA phone update
- Lonestar Electrical: Kyla/Russ Google Workspace setup, 2FA bypass
- AD2 diagnostics and NAS connectivity tests

PENDING: Investigate why newest test_date is Jan 19 despite daily tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 20:16:24 -07:00
parent 1a26eb051a
commit 470638ff86
24 changed files with 2498 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
# Update MFA phone number for Lesley Roth @ BG Builders
$ErrorActionPreference = "Stop"
$lesleyUPN = "lesley@bgbuildersllc.com"
$newPhone = "+1 4804954511"
$tenantId = "ededa4fb-f6eb-4398-851d-5eb3e11fab27"
Import-Module Microsoft.Graph.Authentication
Import-Module Microsoft.Graph.Users
Connect-MgGraph -TenantId $tenantId -Scopes 'UserAuthenticationMethod.ReadWrite.All','User.ReadWrite.All' -NoWelcome
Write-Output "=== Current Auth Methods for Lesley ==="
$methods = Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/v1.0/users/$lesleyUPN/authentication/phoneMethods"
if ($methods.value.Count -gt 0) {
foreach ($m in $methods.value) {
Write-Output " ID: $($m.id) | Type: $($m.phoneType) | Number: $($m.phoneNumber)"
}
} else {
Write-Output " No phone methods registered"
}
Write-Output "`n=== Updating MFA Phone ==="
# Phone method ID for mobile is always "3179e48a-750b-4051-897c-87b9720928f7"
$mobileMethodId = "3179e48a-750b-4051-897c-87b9720928f7"
try {
# Try to update existing mobile phone method
Invoke-MgGraphRequest -Method PUT -Uri "https://graph.microsoft.com/v1.0/users/$lesleyUPN/authentication/phoneMethods/$mobileMethodId" -Body @{
phoneNumber = $newPhone
phoneType = "mobile"
}
Write-Output "[OK] Mobile phone updated to $newPhone"
} catch {
Write-Output "[INFO] PUT failed, trying POST to create new method..."
try {
Invoke-MgGraphRequest -Method POST -Uri "https://graph.microsoft.com/v1.0/users/$lesleyUPN/authentication/phoneMethods" -Body @{
phoneNumber = $newPhone
phoneType = "mobile"
}
Write-Output "[OK] Mobile phone created: $newPhone"
} catch {
Write-Output "[ERROR] Failed: $_"
}
}
Write-Output "`n=== Verify Updated Methods ==="
$methods = Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/v1.0/users/$lesleyUPN/authentication/phoneMethods"
foreach ($m in $methods.value) {
Write-Output " ID: $($m.id) | Type: $($m.phoneType) | Number: $($m.phoneNumber)"
}
Disconnect-MgGraph