Coffee Break: NAVDiag


In the previous two posts, Automation Part 1 and Part 2, we talked about how to easily bring PowerShell into Dynamics NAV.

Based on the applicability and interest shown so far we wanted to continue on the previous thread and address some of the suggestions we received, as well as add some functionality. We called the result NAVDiag. You can use this as a tool that helps you simplify and speed up the troubleshooting. But above all: We hope this will create engagement around tooling possibilities and inspire for more suggestions.

In this edition, we have added examples of how to read the license file and read the config file. Exporting license file is done using a NAV cmdlet, and because running NAV cmdlets requires elevated permissions,  in order to run NAV cmdlets from this tool your NAV Server account must be an admin account. In general, we are trying to avoid functionalities that require elevated permissions in these examples, as the point is simplicity and the ability to use this on a default configuration without any further installation or modifications needed. But after your feedback we thought this could be useful to have under a caution that running actions that invoke NAV cmdlets will fail unless the NAV Server user account has elevated permissions.

Another functionality we added is capturing repro steps when troubleshooting using Windows Steps Recorder. This is initiated using client side .NET interoperability, so this functionality will not run (nor be present) on a Web client (see limitations). The same would apply to collecting diagnostic details client side (can be used on Windows client only).  Collecting client-side data was one of the questions/suggestions we got and is something that we will come back to soon. For now, we would like to wrap up the functionalities that do not require any changes to default configuration.

So here it is:

NAVdiag in action

The tool now allows you to collect diagnostics, the same diagnostics we presented in the last post, with added examples of reading the config file, the license file and Steps Recorder.

Record Steps action will allow user to record problem steps and save the output. This is basically just a call to the built-in Windows Steps Recorder function, but still useful to have as a part of the tool. Finally, the License File action will read the license file, the specified NAV Server account has elevated permissions.

There will be more coming up but if you find this useful and have further ideas about how this can be improved and used in your daily tasks, please let us know.

navcoffebreaklogo

NAVDiag Log object

 

Comments (3)

  1. Alex says:

    Nice work. Just tried it out and it seems to be working fine. However, as a partner with multiple databases and services on one machine the “Get Service State” does not help me that much (same for customers, if they would have their test environment on the same server). Is it possible to display the NAV server instance in the “Get Service State” log? Or maybe you could just limit the “Get NAV server instances” and “Get Service State” to the current database?

  2. Peter says:

    Nice, but wouldn’t it be possible to prompt the user for user/pwd of a user with elevated privileges and let this user execute the powershell?

    1. Thanks Peter, absolutely, and that is an idea we will come back to (along with client side execution). In the first round, we wanted to focus on using default installation, just having everythingun server side. Then there is the possibility to run it client side (but loading the dlls client side too), etc. we will still come back to that. The most important thing here was to get inspired and get your feedback and ideas, so thank you for that! We will try to address all these in the future

Skip to main content