Search code examples
c#powershellmicrosoft-dynamicsdynamics-navdynamics-nav-2009

Microsoft Dynamics Nav 2009 user


In Microsoft Dynamics Nav 2013 and higher, Microsoft announced powershell cmdlets and its very easy to get all Nav users using powershell command Get-NAVServerUser

Any idea how to get all users in Nav 2009 and lower where this is not supported? I need a way to get this users programmatically using powershell or c#.


Solution

  • There is no direct equivalent to the powershell commands before NAV2013.

    In NAV 2009 you can use Web Services to expose information, which you can then consume via a C# (or most other languages that support wsdl), this requires configuration changes and possibly the creation of a pages or codeunits to show the information.

    There are some samples at Freddy's blog here

    Web services can be back-ported to at least 5.0 and possibly further back.

    Another approach is use the C/ODBC driver to connect to NAV which you should be able to implement with some kind of wrapper in C#, the documentation is included on the installation media with each version.

    A third approach would be to write a query directly to the database, you could also use views and stored procedures here.