Files
claudetools/temp/bgb-lesley-check.ps1
Mike Swanson 470638ff86 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>
2026-03-13 06:08:31 -07:00

52 lines
1.9 KiB
PowerShell

# Check Lesley's email activity since disable
$ErrorActionPreference = "Stop"
$lesleyUPN = "lesley@bgbuildersllc.com"
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName "sysadmin@bgbuildersllc.com" -ShowBanner:$false
$startDate = (Get-Date).AddDays(-3)
$endDate = Get-Date
Write-Output "=== MAILBOX STATUS ==="
$mbx = Get-Mailbox -Identity $lesleyUPN
$stats = Get-MailboxStatistics -Identity $lesleyUPN
Write-Output "Type: $($mbx.RecipientTypeDetails)"
Write-Output "LitigationHold: $($mbx.LitigationHoldEnabled)"
Write-Output "ItemCount: $($stats.ItemCount)"
Write-Output "TotalSize: $($stats.TotalItemSize)"
Write-Output "`n=== SENT MESSAGES (last 3 days) ==="
$sent = Get-MessageTraceV2 -SenderAddress $lesleyUPN -StartDate $startDate -EndDate $endDate
if ($sent) {
$sent | Format-Table Received,RecipientAddress,Subject -AutoSize
} else {
Write-Output "None found"
}
Write-Output "`n=== RECEIVED MESSAGES (last 3 days) ==="
$recv = Get-MessageTraceV2 -RecipientAddress $lesleyUPN -StartDate $startDate -EndDate $endDate
if ($recv) {
$recv | Select-Object -First 20 | Format-Table Received,SenderAddress,Subject -AutoSize
} else {
Write-Output "None found"
}
Write-Output "`n=== INBOX RULES ==="
$rules = Get-InboxRule -Mailbox $lesleyUPN
if ($rules) {
$rules | Format-Table Name,Enabled,Description -AutoSize
} else {
Write-Output "No inbox rules"
}
Write-Output "`n=== FORWARDING CONFIG ==="
Write-Output "ForwardingAddress: $($mbx.ForwardingAddress)"
Write-Output "ForwardingSmtpAddress: $($mbx.ForwardingSmtpAddress)"
Write-Output "DeliverToMailboxAndForward: $($mbx.DeliverToMailboxAndForward)"
Write-Output "`n=== FOLDER ITEM COUNTS ==="
Get-MailboxFolderStatistics -Identity $lesleyUPN | Where-Object { $_.ItemsInFolder -gt 0 } | Sort-Object ItemsInFolder -Descending | Select-Object -First 15 | Format-Table Name,FolderType,ItemsInFolder,FolderSize -AutoSize
Disconnect-ExchangeOnline -Confirm:$false