{# R36.4 (Hani #1 2026-10-27/28): Windows Update from NEXXVU. Windows lets no remote session install updates, so NEXXVU's update job runs as a Windows SYSTEM task: started with the administrator account (used once), or - once unattended updates are set up - with NEXXVU's own update account, which may start only those tasks. The read-only account follows the job; it installs one update at a time, so the bar shows real progress. #} {% set job = rep.job or {} %}{% set waiting = uv.waiting or [] %}{% set ua = uv.account %}{% set ua_ready = ua and ua.ready %}

Checked by itself once a day with NEXXVU's read-only account, from the result of NEXXVU's last Windows Update check on the device {{ fresh_tag("updates:windows") }}. {% if row.checked_at %}Last read {{ row.checked_at[:16]|replace('T', ' ') }} UTC{% if not row.ok %} failed: {{ row.error }}{% endif %}.{% else %}Not read yet.{% endif %}

{% if not uv.running %} {% if ua_ready %}
{% else %}{% endif %} {% if waiting %}{% endif %}{% endif %}
{% if uv.running %}
{{ {'starting': 'Starting Windows Update on the device', 'searching': 'Windows is searching for updates', 'downloading': 'Windows is downloading', 'installing': 'Windows is installing'}.get(job.state, 'Windows Update is running') }}{% if job.state in ['downloading', 'installing'] and job.steps %} - update {{ (job.step // 2) + 1 }} of {{ job.steps // 2 }}{% endif %}{% if job.started %} · since {{ job.started[11:19] }} UTC{% endif %}
{{ uv.percent }} % {{ uv.percent }} %
{% if job.current %}

{{ job.current }}

{% endif %} {% if job.restart %}

Windows restarts one minute after the install if an update needs it.

{% endif %} This tab refreshes every 15 seconds. Large updates can take an hour.
{% endif %} {% if row.ok %}
System
{{ (rep.os or {}).name or 'Windows' }}{% if (rep.os or {}).version %} (build {{ rep.os.version }}){% endif %}
Last check by NEXXVU
{% if job.finished %}{{ job.finished[:16]|replace('T', ' ') }} UTC ({{ 'install' if job.mode == 'install' else 'check' }}{% if job.state == 'failed' %}, failed: {{ job.error }}{% endif %}){% elif job.state == 'none' %}never - use Check for updates{% else %}running{% endif %}
Waiting
{% if job.state == 'none' %}unknown{% else %}{{ waiting|length }} update{{ '' if waiting|length == 1 else 's' }}{% if row.security %}, {{ row.security }} for security{% endif %}{% endif %}
Restart
{% if rep.reboot_required %}required - Tools › Reboot{% else %}not needed{% endif %}
Unattended updates
{% if ua_ready %}set up with NEXXVU's update account {{ ua.user }} - no password needed; update plans can include this device{% else %}not set up{% endif %}
{% if job.mode == 'install' and job.state == 'done' and rep.updates %}
{% for u in rep.updates %}{% endfor %}
Last install
UpdateResult
{{ u.title }}{{ u.result or 'not installed' }}
{% elif waiting %}
{% for u in waiting %}{% endfor %}
UpdateKBSizeRestart
{{ u.title }}{% if u.security %} {{ u.severity or 'security' }}{% endif %}
{{ u.categories }}
{{ u.kb or '–' }}{{ ((u.size / 1048576)|round(1) ~ ' MB') if u.size else '–' }}{{ 'may be needed' if u.reboot else 'no' }}
{% elif job.state == 'done' %}

Nothing to install: Windows is up to date.

{% endif %} {% if rep.history %}
Windows Update history ({{ rep.history|length }})
{% endif %} {% endif %}

Unattended updates {{ fresh_tag("updates:windows-unattended") }}

{% if ua_ready %}

NEXXVU's update account {{ ua.user }} (created {{ (ua.created_at or '')[:10] }}{% if ua.source %}, accepted only from {{ ua.source }}{% endif %}) can only start NEXXVU's Windows Update tasks: check, install, and install with a restart if needed. Check and Install above need no password; add this device to an update plan (Settings › Update plans) to update it on a schedule.

{% else %}

Set up once with an administrator account: NEXXVU creates a standard Windows account (never in Administrators) that signs in only with NEXXVU's key from this Portal and may start only NEXXVU's Windows Update tasks. Then updates run without a password - from here, from the device list, and on a schedule with an update plan. No administrator password is stored.

{% endif %}
{% set modes = ['install'] if ua_ready else ['scan', 'install'] %} {% for mode in modes %}
{% if tool_return == 'setup' %}{% endif %}

{{ 'Check' if mode == 'scan' else 'Update' }} {{ inventory.asset.name }}

{% if mode == 'scan' %}NEXXVU starts Windows Update's search on the device as a Windows task and shows what is waiting. Nothing is installed.{% else %}NEXXVU starts Windows Update on the device as a Windows task: it downloads and installs the {{ waiting|length }} waiting update{{ '' if waiting|length == 1 else 's' }}, one after the other. Users can keep working; some updates finish at the next restart.{% endif %} {% if ua_ready %}It runs with NEXXVU's update account: no password is needed.{% else %}Windows allows this only from its own system account, so the administrator account starts the task and is then discarded.{% endif %}

{% if not ua_ready %} {% endif %} {% if mode == 'install' %} {% endif %}
{% endfor %} {% for action in ['account_setup', 'account_remove'] if (action == 'account_setup' and not ua_ready) or (action == 'account_remove' and ua_ready) %}

{{ 'Set up unattended updates on' if action == 'account_setup' else 'Remove the update account from' }} {{ inventory.asset.name }}

{% if action == 'account_setup' %}NEXXVU creates the standard account nexxvu-upd-… with its key (accepted only from this Portal), restarts the SSH service once, and registers its three Windows Update tasks. Takes about a minute.{% else %}NEXXVU deletes the update account, its key and its Windows Update tasks. Updates then ask for an administrator account again.{% endif %}

{% if action == 'account_setup' %}{% endif %}
{% endfor %}