Move 150+ scripts from root and scripts/ into client/project directories: - clients/dataforth/scripts/ (110 files: AD2, sync, SSH, DB, DOS scripts) - clients/bg-builders/scripts/ (14 files: Lesley mgmt, Exchange, termination) - clients/internal-infrastructure/scripts/ (10 files: GDAP, Gitea, backups) - projects/msp-tools/scripts/ (9 files: CIPP, MSP onboarding, Datto) - projects/gururmm-agent/scripts/ (3 files: API test, JWT, record counts) - clients/glaztech/scripts/ (1 file: CentraStage removal) Also reorganized: - VPN scripts → infrastructure/vpn-configs/ - Retrieved API/JS files → api/ - Forum posts → projects/community-forum/forum-posts/ - SSH docs → clients/internal-infrastructure/docs/ - NWTOC/CTONW docs → projects/wrightstown-smarthome/docs/ - ACG website files → projects/internal/acg-website-2025/ - Dataforth docs → clients/dataforth/docs/ - schema-retrieved.sql → docs/database/ Deleted 24 tmp_*.ps1 one-off debug scripts (preserved in git history). Root reduced from 220+ files to 62 items (docs + directories only). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
72 lines
2.9 KiB
PowerShell
72 lines
2.9 KiB
PowerShell
# BG Builders - Verify Lesley Device Wipe Status
|
|
$ErrorActionPreference = "Stop"
|
|
$tenantId = "ededa4fb-f6eb-4398-851d-5eb3e11fab27"
|
|
$lesleyUPN = "lesley@bgbuildersllc.com"
|
|
|
|
Write-Output "========================================="
|
|
Write-Output " Verify Device Wipe - Lesley Roth"
|
|
Write-Output " $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')"
|
|
Write-Output "========================================="
|
|
|
|
# --- Check Intune Managed Devices ---
|
|
Write-Output "`n[CHECK 1] Intune Managed Devices..."
|
|
Import-Module Microsoft.Graph.Authentication
|
|
Import-Module Microsoft.Graph.DeviceManagement
|
|
Connect-MgGraph -TenantId $tenantId -Scopes 'DeviceManagementManagedDevices.Read.All' -NoWelcome
|
|
Write-Output "[OK] Connected to Graph"
|
|
|
|
$devices = Get-MgDeviceManagementManagedDevice -Filter "userPrincipalName eq '$lesleyUPN'" 2>$null
|
|
if ($devices) {
|
|
foreach ($d in $devices) {
|
|
Write-Output ""
|
|
Write-Output " Device: $($d.DeviceName)"
|
|
Write-Output " OS: $($d.OperatingSystem) $($d.OsVersion)"
|
|
Write-Output " Compliance: $($d.ComplianceState)"
|
|
Write-Output " Management State: $($d.ManagementState)"
|
|
Write-Output " Last Sync: $($d.LastSyncDateTime)"
|
|
Write-Output " Device Action: $($d.DeviceActionResults | ForEach-Object { "$($_.ActionName): $($_.ActionState)" })"
|
|
}
|
|
} else {
|
|
Write-Output " [INFO] No Intune-managed devices found for $lesleyUPN"
|
|
}
|
|
|
|
Disconnect-MgGraph
|
|
|
|
# --- Check EAS Devices ---
|
|
Write-Output "`n[CHECK 2] Exchange ActiveSync Devices..."
|
|
Import-Module ExchangeOnlineManagement
|
|
Connect-ExchangeOnline -UserPrincipalName "sysadmin@bgbuildersllc.com" -ShowBanner:$false
|
|
Write-Output "[OK] Connected to Exchange Online"
|
|
|
|
$easDevices = Get-MobileDevice -Mailbox $lesleyUPN 2>$null
|
|
if ($easDevices) {
|
|
foreach ($eas in $easDevices) {
|
|
$stats = Get-MobileDeviceStatistics -Identity $eas.Identity 2>$null
|
|
Write-Output ""
|
|
Write-Output " Device: $($eas.FriendlyName)"
|
|
Write-Output " Type: $($eas.DeviceType)"
|
|
Write-Output " OS: $($eas.DeviceOS)"
|
|
Write-Output " Access State: $($eas.DeviceAccessState)"
|
|
Write-Output " First Sync: $($eas.FirstSyncTime)"
|
|
if ($stats) {
|
|
Write-Output " Last Sync: $($stats.LastSuccessSync)"
|
|
Write-Output " Wipe Status: $($stats.DeviceWipeSentTime)"
|
|
Write-Output " Wipe Ack: $($stats.DeviceWipeAckTime)"
|
|
Write-Output " Status: $($stats.Status)"
|
|
}
|
|
}
|
|
} else {
|
|
Write-Output " [INFO] No EAS devices found for $lesleyUPN"
|
|
}
|
|
|
|
# --- Check account status ---
|
|
Write-Output "`n[CHECK 3] Account Status..."
|
|
$mbx = Get-Mailbox -Identity $lesleyUPN -ErrorAction SilentlyContinue
|
|
if ($mbx) {
|
|
Write-Output " Mailbox Type: $($mbx.RecipientTypeDetails)"
|
|
Write-Output " Litigation Hold: $($mbx.LitigationHoldEnabled)"
|
|
}
|
|
|
|
Disconnect-ExchangeOnline -Confirm:$false
|
|
Write-Output "`n[OK] Verification complete"
|