NAV 2009 Service Tier Admin
Targets Microsoft Dynamics NAV 2009 (incl. R2) Service Tiers (NST = NAV Server) and NAS (NAV Application Server / Job Queue) running as Windows services. The bundled script
scripts/Get-NavServiceTier.ps1enumerates services, parses CustomSettings.config, and emits JSON; the agent (you) writes the narrative. Inventory is read-only; the-Restartaction stops/starts a service in the correct order and is opt-in — always confirm with the user before using it. The script never calls an LLM.
SCRIPT = this skill's scripts/Get-NavServiceTier.ps1. Requires PowerShell 7+ (pwsh).
Reads the local machine by default; use -ComputerName for remote targets (requires admin +
WinRM/CIM access on the target). Full parameter and schema reference in
REFERENCE.md.
Permissions & auth
- Local inventory: any account with rights to query Win32_Service (typically local admin).
Reading CustomSettings.config in
Program Files\Microsoft Dynamics NAV\...\Serviceusually requires local admin or membership in the local Administrators group. - Remote inventory (
-ComputerName): needs CIM/WinRM connectivity (Test-WSManorwinrm quickconfigon the target) and an account with admin rights on the target machine. - Restart: local admin (or
SeServiceLogonRight-equivalent) on the machine hosting the service. For remote restart the same WinRM/admin requirements apply. - If the Service folder belongs to a different account (e.g. MSA), the config file may not be
readable; the instance will surface an
errorfield rather than aborting the whole inventory.
How to run
Always run with pwsh. Parse the JSON it prints on stdout.
| Want | Pass |
|---|---|
| Inventory all instances on this server | (no extra params) |
| Inventory a named instance | -Instance NAVPROD |
| Inventory a remote server | -ComputerName NAVSRV01 |
| Include every config key, not just curated ones | -IncludeFullConfig |
| Restart a named instance (opt-in) | -Instance NAVPROD -Restart |
| Save full JSON to file | -OutFile C:\ops\nav-tiers.json |
# Full inventory of all NAV service tiers on the local machine
pwsh -File SCRIPT -OutFile C:\ops\nav-tiers.json
# Check what database a specific instance is pointing at
pwsh -File SCRIPT -Instance NAVPROD
# Inventory all instances on a remote server
pwsh -File SCRIPT -ComputerName NAVSRV01 -OutFile C:\ops\navsrv01-tiers.json
# Restart the NAVTEST instance (confirm with user first — disconnects all clients)
pwsh -File SCRIPT -Instance NAVTEST -Restart
Output contract
- Without
-OutFile→ full JSON on stdout. - With
-OutFile→ full JSON to the file; a compact summary (instance names + status) on stdout. Prefer-OutFilefor multi-instance inventories so context stays small.
Top level: status (ok / partial / error), generated_at (UTC ISO-8601), computer,
and instances — one entry per discovered service:
{
"status": "ok",
"generated_at": "2026-06-10T09:00:00.0000000Z",
"computer": "NAVSRV01",
"instances": [
{
"serviceName": "MicrosoftDynamicsNavServer$NAVPROD",
"instanceName": "NAVPROD",
"status": "Running",
"startMode": "Auto",
"account": "DOMAIN\\svc-nav",
"exePath": "C:\\Program Files\\Microsoft Dynamics NAV\\60\\Service\\Microsoft.Dynamics.Nav.Server.exe",
"configPath": "C:\\Program Files\\Microsoft Dynamics NAV\\60\\Service\\Instances\\NAVPROD\\CustomSettings.config",
"settings": {
"DatabaseServer": "SQLSRV01",
"DatabaseInstance": "",
"DatabaseName": "Navision_PROD",
"ServerInstance": "NAVPROD",
"ClientServicesPort": "7046",
"SOAPServicesPort": "7047",
"ManagementServicesPort": "7045",
"ClientServicesCredentialType": "Windows",
"SOAPServicesEnabled": "true",
"ServicesCertificateThumbprint": ""
},
"nas": {
"codeunit": "450",
"method": "JOBQUEUE",
"argument": "",
"enabled": true
},
"ports": {
"client": 7046,
"soap": 7047,
"management": 7045
},
"error": null
}
]
}
When -Restart is passed the top level also contains:
"restart": {
"requested": "2026-06-10T09:05:00.0000000Z",
"instance": "NAVPROD",
"before": "Running",
"after": "Running",
"ok": true
}
status is partial when at least one instance has a non-null error field. With -OutFile,
stdout instead carries a compact object: { status, out_file, instances: [{ instanceName, status }] }.
What you (the agent) do with the result
- Run the script, parse the JSON.
- Report each instance: name, running/stopped, service account, DB target
(
settings.DatabaseServer+settings.DatabaseName), and the three ports. - Flag a Stopped instance — ask whether it should be running and offer to restart (with the
user's explicit consent, using
-Restart). - Flag NAS configured but service stopped: if
nas.enabled = trueandstatus != Running, the Job Queue is not processing — this is usually urgent. - "Users can't connect": cross-check
status = Running,ClientServicesPort(must match what the client profile has), andClientServicesCredentialType. If status and port look correct, the issue may be network/firewall or Kerberos/SPN — point to nav2009-troubleshooting for the next step. - Before restarting: confirm with the user ("this will disconnect all active RTC clients on
NAVPROD — proceed?") then run with
-Restart. Verifyrestart.after.status = Runningandrestart.ok = truein the output. - For the database this instance points at: the nav2009-sql-performance skill can triage
that SQL Server instance using the
DatabaseServerandDatabaseNamevalues from the output.
Errors
- No NAV services found: service-name pattern is
MicrosoftDynamicsNavServer*; single-instance NAV 2009 SP1 may be exactlyMicrosoftDynamicsNavServer(no$suffix). Default config path:C:\Program Files\Microsoft Dynamics NAV\60\Service\CustomSettings.config. - CustomSettings.config not found or unparseable: the instance entry will have an
errorfield with the message;settings,nas, andportswill benull. Suggest locating the config manually in the Service folder next to the NAV Server executable. - Remote CIM access denied: check WinRM is enabled on the target (
winrm quickconfig) and that the running account has admin rights there. - Restart timed out: the
-RestartTimeoutSec(default 60) elapsed before the service reachedRunning;restart.okwill befalseandrestart.afterwill show the actual state. Check Windows Event Log on the target for service start failures.