web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Creating User via Code

(0) ShareShare
ReportReport
Posted on by 85

Hello All,

Can we create user dynamically via coding. Because while creating a Test Codeunit i needs to test either database has already user or not, If there is no user then it will get created automatically with their windows account.

Answers and suggestions will be appreciated.

*This post is locked for comments

I have the same question (0)
  • Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    You can use POwershell and the New-NavServerUser cmdlet:

    https://docs.microsoft.com/en-us/powershell/module/microsoft.dynamics.nav.management/new-navserveruser?view=businesscentral-ps

    No other ways are recommended.

  • Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Use the New-NAVServerUser cmdlet to create the users, you can execute the powershell command using the code, please check the below blog how to execute powershell from CAL

    blogs.msdn.microsoft.com/.../coffee-break-use-the-powershell-runner-add-in

  • Murari Jangid Profile Picture
    85 on at

    I have done the above problem with another solution, Anyway thanks for your valuable time.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans