2 min read

How to collect environment info for Dynamics NAV client using PowerShell

Following Lars script for 3-tier troubleshooting, I’ve created my own script which collects info from PC where Dynamics NAV clients are installed. This info could be used for further investigations and potential problems findings.

What does script do?
In current folder (where from script was started) is created subfolder ‘Results’. If ‘Results’ folder already exists, then it will be renamed to ‘OldResults’.
Result folder includes text formated files:
  • CCevents.txt – includes last 100 events from event logs which includes ‘finsql’. This can be used to analyze what events were raised by ‘finsql.exe’.
  • RTCevents.txt. – includes last 100 events from event logs which includes ‘Dynamics’. This can be used to analyze what event was raised by “Dynamics”.
  • CodePages.txt – includes code page numbers from registry: ACP (active code page); OEMCP (OEM code page). And shows does these numbers point to correct nls. This could be used to troubleshoot issues with regional settings
  • OSDeatails.txt – includes all information about operating system. Just to be clear what OS, what version is installed, memory setup is isntalled.
  • Printers.txt – includes all installed printers. Some times it could show potential problems in printing process.
  • InstalledApp.txt – includes all applications and versions installed on current pc. Taken from winregistry. This could get ideas about what installed apps are not acceptable together with NAV.
  • FilesVersions.txt – this file is created if there is Dynamics NAV client installed. Script search for specific windows registry entry which points to Dynamics NAV folder. Folder name depends on is OS 32-bit or 64-bit. If NAV folder found then ‘FileVersions.txt’ includes all exe and dll information. This could be used to check does all Dynamics NAV components match the same version. If NAV is not installed then FilesVersion.txt is not created – it means we found problem 🙂
  • diagLog.txt – includes information about what steps and when have been executed. Just to know which part got error if it occurs.

Script is attached here. But also can be found at Technet Scriptcenter.

How to run script?

Script requires permissions to run, so you need:

  1. Save Script somewhere on local disk.
  2. Open PowerShell console “as Administrator”
  3. Run “Set-ExecutionPolicy Unrestricted”
  4. Go to saved script  ‘cd C:\Temp\’
  5. Run script like ‘NAV_Client_Diag.ps1’
  6. Close PowerShell console.
  7. Check files in subfolder ‘Results’.


Any comments/suggestions/error reports are welcome.

These postings are provided “AS IS” with no warranties and confer no rights. You assume all risk for your use.

Gedas Busniauskas

Microsoft Lithuania

Microsoft Customer Service and Support (CSS) EMEA