update M365 deployment script to try not to depend on previous deployments

This commit is contained in:
2026-10-29 14:29:37 -04:00
parent e2163a6158
commit 3e24920646
7 changed files with 465 additions and 85 deletions
+38
View File
@@ -14,12 +14,33 @@ You can then run any of the scripts using the Run-Script function:
If you're using an RMM tool, the scripts in the /rmm directory are all that's needed to hook the main script in this directory.
For QuickBooks image-backup preparation, use [Stop-QuickBooksDesktop.ps1](Stop-QuickBooksDesktop.ps1)
and [Start-QuickBooksDesktop.ps1](Start-QuickBooksDesktop.ps1). The permanent
[stop shim](rmm/Stop-QuickBooksDesktop.ps1) defines the host's exact company-file
share names as a semicolon-separated string and pairs with the
[start shim](rmm/Start-QuickBooksDesktop.ps1). See [deployment, exit codes, and
recovery](docs/QuickBooks-Backup.md) before scheduling: desktop, database-service,
share-isolation, or open-handle failures prevent backup; post restores the
recorded services and share access. Each shim downloads its matching repository
script, `Tools.ps1`, and the shared QuickBooks routines live on every run. Only
the two shims need deployment; recovery state persists locally and no code is cached.
For DSA collection, paste [rmm/Get-DSAManifest.ps1](rmm/Get-DSAManifest.ps1) into the RMM caller, preserving its configured platform variables. This caller selects TLS 1.2 before downloading, stops on bootstrap failure, and dot-sources the downloaded tools in the caller's scope. Updating the repository alone will not change an existing RMM caller.
For download failures, use the standalone [Test-FileDownload.ps1](Test-FileDownload.ps1) diagnostic. See [the RMM caller, report guide, and shared caller audit](docs/FileDownload-Diagnostics.md). It compares the existing helper, BITS, and direct GET without changing production download behavior or running downloaded files.
`Get-DSAManifest.ps1` uses `Download-FileDirectly`, which passes the original URL to BITS without preliminary `Get-AbsoluteURI` or `IsURLValid` requests. It accepts the same URL and optional `-File` arguments as `Download-File`, waits for completion, and throws on BITS errors. If `-File` is omitted, its temporary filename comes from the original URL; supply `-File` for extensionless URLs or URLs with query strings. Existing `Download-File` callers retain their previous behavior. Publish `Tools.ps1` together with `Get-DSAManifest.ps1` so the new helper is available.
## Environment inventory
Use [Get-EnvironmentInventory.ps1](Get-EnvironmentInventory.ps1) to collect file
shares, networks, printer connections, wireless observations, and internet egress
into versioned JSON on Windows PowerShell 5.1. Reports describe the environment;
endpoint identity is optional and no Hudu credentials or module are required.
The [RMM caller](rmm/Get-EnvironmentInventory.ps1) supports optional upload through
the existing Filedrop helper. See the [options and data contract](docs/Environment-Inventory.md)
and [JSON schema](resources/environment-inventory/schema-v1.json). No importer is included.
## Microsoft 365 deployment
See [Office365-Deployment.md](docs/Office365-Deployment.md) for the Syncro dropdowns and clean deployment workflow. Upload the shim in `rmm/Install-MicrosoftOffice365.ps1`; publish the core installer and `resources/office/Office-UserCleanup.ps1` together first. The shim uses the existing `Tools.ps1` unchanged; deployment, host relaunch, and result handling live in the main repository script. `ValidateBeforeChanges` defaults to `true` (checks and stages media only); explicitly select `false` to enable deployment. The workload runs in Windows PowerShell 5.1, requires an explicit subscription selection, removes Office and its companion apps, preserves Windows work-account sign-in, and installs the matching suite silently using Microsoft's current ODT. It then installs new Outlook and per-machine OneDrive using Microsoft's signed installers, plus current Teams only when the selected subscription includes Teams. Pending per-user cleanup is reported separately and protects the reinstalled apps. Action/error diagnostics use the existing Tools log; the result is printed to Syncro.
@@ -47,6 +68,22 @@ Each input returns a `System.Boolean`: `true`, `$true`, `yes`, `y`, and `1` beco
`Get-DSAManifest.ps1` uses this helper for its three options. Publish it together with the updated `Tools.ps1` so the helper is available to the RMM caller.
## Converting RMM lists
Use `ConvertTo-RmmList` for an RMM string containing semicolon-separated values:
```powershell
$Paths = @(ConvertTo-RmmList -Value 'C:\QB Data; \\server\Archive;')
$Shares = @(ConvertTo-RmmList -Value $QuickBooksShareNames)
```
The helper trims surrounding whitespace and omits empty entries. It preserves
item order, duplicates, case, internal spaces, commas, and backslashes. It does
not evaluate text, resolve paths, or check whether files/shares exist. Semicolons
are always separators; there is no quoting or escaping syntax. Use `@(...)` so
zero, one, and multiple items always produce an array. Publish the updated
`Tools.ps1` with callers that use this new helper.
## Uploading files
After dot-sourcing `Tools.ps1`, scripts can upload a completed file to the Emberkom FileDrop:
@@ -72,5 +109,6 @@ powershell.exe -NoProfile -File .\tests\Upload-File.Tests.ps1
powershell.exe -NoProfile -File .\tests\Get-DSAManifest.Tests.ps1
powershell.exe -NoProfile -File .\tests\Download-File.Tests.ps1
powershell.exe -NoProfile -File .\tests\ConvertTo-RmmBoolean.Tests.ps1
powershell.exe -NoProfile -File .\tests\ConvertTo-RmmList.Tests.ps1
powershell.exe -NoProfile -File .\tests\Get-AllNetworkDrives.Tests.ps1
```