Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Creating User via Code

Posted on by 77

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

  • Murari Jangid Profile Picture
    Murari Jangid 77 on at
    RE: Creating User via Code

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

  • Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Creating User via Code

    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

  • Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Creating User via Code

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans