Persist NinjaOne context for scheduled scans
This commit is contained in:
@@ -112,6 +112,28 @@ Runtime:
|
||||
-OutputPath "..\reports\ocsentinel-summary.json"
|
||||
```
|
||||
|
||||
## Repair Missing NinjaOne Context
|
||||
|
||||
NinjaOne exposes `NINJA_ORGANIZATION_ID`, `NINJA_ORGANIZATION_NAME`,
|
||||
`NINJA_AGENT_MACHINE_ID`, and location values only while an automation runs.
|
||||
The scheduled OCSentinel task runs later as `SYSTEM`, so those values must be
|
||||
persisted during an actual NinjaOne automation.
|
||||
|
||||
If the console shows `Organisation unbekannt`, create a temporary NinjaOne
|
||||
PowerShell automation named `OCSentinel - NinjaOne Kontext aktualisieren` and
|
||||
copy `scripts/refresh-ocsentinel-ninja-context.ps1` into the editor. Run it as
|
||||
`SYSTEM` in 64-bit PowerShell once against the affected devices or policy.
|
||||
|
||||
The script has no script variables and does the following safely:
|
||||
|
||||
1. updates the installed client through the stable, version-independent manifest;
|
||||
2. stores the current NinjaOne organization, location, node, and machine values;
|
||||
3. starts one signed status scan and upload using that stored context.
|
||||
|
||||
Expected output includes `OCSENTINEL_NINJA_CONTEXT=updated`. Do not run this
|
||||
script from an interactive PowerShell session, because NinjaOne does not expose
|
||||
the required environment values there.
|
||||
|
||||
## Secret Bootstrap
|
||||
|
||||
```powershell
|
||||
|
||||
Reference in New Issue
Block a user